	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function calc_scale
_calc_scale:                            ## @calc_scale
	.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	%r12
	pushq	%rbx
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	(%rsi), %ecx
	xorl	%r12d, %r12d
	cmpl	%edi, %ecx
	je	LBB0_7
## %bb.1:
	movq	%rsi, %r14
	movl	%edi, %r15d
	movl	%edi, %eax
	shll	$12, %eax
	xorl	%edx, %edx
	divl	%ecx
	movl	%eax, %ebx
	andl	$-8, %ebx
	cmpl	$4097, %ebx                     ## imm = 0x1001
	jl	LBB0_5
	.p2align	4, 0x90
LBB0_2:                                 ## =>This Inner Loop Header: Depth=1
	movl	%r15d, %edi
	movl	%ebx, %esi
	callq	_size_dst
	cmpl	(%r14), %eax
	jae	LBB0_5
## %bb.3:                               ##   in Loop: Header=BB0_2 Depth=1
	leal	-8(%rbx), %r12d
	cmpl	$4104, %ebx                     ## imm = 0x1008
	movl	%r12d, %ebx
	jg	LBB0_2
	jmp	LBB0_6
LBB0_5:
	movl	%ebx, %r12d
LBB0_6:
	movl	%r15d, %edi
	movl	%r12d, %esi
	callq	_size_dst
	movl	%eax, (%r14)
LBB0_7:
	movl	%r12d, %eax
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.no_dead_strip	_calc_scale
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function calc_scale
_calc_scale:                            ; @calc_scale
	.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
	ldr	w8, [x1]
	cmp	w8, w0
	b.ne	LBB0_2
; %bb.1:
	mov	w22, #0
	b	LBB0_8
LBB0_2:
	mov	x19, x1
	mov	x20, x0
	lsl	w9, w0, #12
	udiv	w8, w9, w8
	and	w21, w8, #0xfffffff8
	cmp	w21, #1, lsl #12                ; =4096
	b.le	LBB0_6
; %bb.3:
	mov	w23, #4104
LBB0_4:                                 ; =>This Inner Loop Header: Depth=1
	mov	x0, x20
	mov	x1, x21
	bl	_size_dst
	ldr	w8, [x19]
	cmp	w0, w8
	b.hs	LBB0_6
; %bb.5:                                ;   in Loop: Header=BB0_4 Depth=1
	sub	w22, w21, #8
	cmp	w21, w23
	mov	x21, x22
	b.gt	LBB0_4
	b	LBB0_7
LBB0_6:
	mov	x22, x21
LBB0_7:
	mov	x0, x20
	mov	x1, x22
	bl	_size_dst
	str	w0, [x19]
LBB0_8:
	mov	x0, x22
	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
	.cfi_endproc
                                        ; -- End function
	.no_dead_strip	_calc_scale
.subsections_via_symbols
