	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function calculate_allocation
_calculate_allocation:                  ## @calculate_allocation
	.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	%edx, %r12d
	movl	%esi, %r14d
	movq	%rdi, %rbx
	movl	%esi, %edi
	notl	%edi
	shrl	$31, %edi
	callq	_gcc_assert
	testq	%rbx, %rbx
	je	LBB0_2
## %bb.1:
	movl	(%rbx), %r15d
	movl	4(%rbx), %ebx
	jmp	LBB0_3
LBB0_2:
	xorl	%r15d, %r15d
	movl	$0, %ebx
	testl	%r14d, %r14d
	je	LBB0_5
LBB0_3:
	movl	%r15d, %eax
	subl	%ebx, %eax
	xorl	%edi, %edi
	cmpl	%r14d, %eax
	setb	%dil
	callq	_gcc_assert
	testl	%r12d, %r12d
	je	LBB0_6
## %bb.4:
	addl	%r14d, %ebx
	movl	%ebx, %r15d
LBB0_5:
	movl	%r15d, %eax
	jmp	LBB0_12
LBB0_6:
	testl	%r15d, %r15d
	je	LBB0_7
## %bb.8:
	cmpl	$15, %r15d
	ja	LBB0_10
## %bb.9:
	addl	%r15d, %r15d
	jmp	LBB0_11
LBB0_7:
	movl	$4, %r15d
	jmp	LBB0_11
LBB0_10:
	leal	(%r15,%r15,2), %r15d
	shrl	%r15d
LBB0_11:
	addl	%r14d, %ebx
	cmpl	%ebx, %r15d
	cmoval	%r15d, %ebx
	movl	%ebx, %eax
LBB0_12:
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.no_dead_strip	_calculate_allocation
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function calculate_allocation
_calculate_allocation:                  ; @calculate_allocation
	.cfi_startproc
; %bb.0:
	stp	x22, x21, [sp, #-48]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 48
	stp	x20, x19, [sp, #16]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #32]             ; 16-byte Folded Spill
	add	x29, sp, #32
	.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
	mov	x20, x2
	mov	x19, x1
	mov	x21, x0
	mvn	w8, w1
	lsr	w0, w8, #31
	bl	_gcc_assert
	cbz	x21, LBB0_2
; %bb.1:
	ldp	w22, w21, [x21]
	b	LBB0_3
LBB0_2:
	mov	w22, #0
	mov	w0, #0
	cbz	w19, LBB0_6
LBB0_3:
	sub	w8, w22, w21
	cmp	w8, w19
	cset	w0, lo
	bl	_gcc_assert
	cbz	w20, LBB0_5
; %bb.4:
	add	w0, w21, w19
	b	LBB0_6
LBB0_5:
	mov	w8, #4
	add	w9, w22, w22, lsl #1
	lsr	w9, w9, #1
	lsl	w10, w22, #1
	cmp	w22, #15
	csel	w9, w9, w10, hi
	cmp	w22, #0
	csel	w8, w8, w9, eq
	add	w9, w21, w19
	cmp	w8, w9
	csel	w0, w8, w9, hi
LBB0_6:
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	ret
	.cfi_endproc
                                        ; -- End function
	.no_dead_strip	_calculate_allocation
.subsections_via_symbols
