	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function expandtofit
_expandtofit:                           ## @expandtofit
	.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
	movq	_SSIZE_MAX@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	incq	%rax
	cmpq	%rsi, %rax
	jae	LBB0_2
## %bb.1:
	movq	_EOVERFLOW@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movq	_errno@GOTPCREL(%rip), %rcx
	movl	%eax, (%rcx)
LBB0_7:
	movl	$-1, %r12d
	jmp	LBB0_8
LBB0_2:
	movq	%rdx, %r14
	movq	%rsi, %rbx
	xorl	%r12d, %r12d
	cmpq	%rsi, (%rdx)
	jae	LBB0_8
## %bb.3:
	movq	%rdi, %r15
	cmpq	%rbx, %rax
	je	LBB0_5
## %bb.4:
	movq	%rbx, %rdi
	callq	_p2roundup
	movq	%rax, %rbx
LBB0_5:
	movq	(%r15), %rdi
	movq	%rbx, %rsi
	callq	_realloc
	testq	%rax, %rax
	je	LBB0_7
## %bb.6:
	movq	%rbx, (%r14)
	movq	%rax, (%r15)
LBB0_8:
	movl	%r12d, %eax
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_SSIZE_MAX,8,3                  ## @SSIZE_MAX
	.comm	_EOVERFLOW,4,2                  ## @EOVERFLOW
	.comm	_errno,4,2                      ## @errno
	.no_dead_strip	_expandtofit
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function expandtofit
_expandtofit:                           ; @expandtofit
	.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
Lloh0:
	adrp	x8, _SSIZE_MAX@GOTPAGE
Lloh1:
	ldr	x8, [x8, _SSIZE_MAX@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	add	x8, x8, #1
	cmp	x8, x1
	b.hs	LBB0_3
; %bb.1:
Lloh3:
	adrp	x8, _EOVERFLOW@GOTPAGE
Lloh4:
	ldr	x8, [x8, _EOVERFLOW@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
Lloh6:
	adrp	x9, _errno@GOTPAGE
Lloh7:
	ldr	x9, [x9, _errno@GOTPAGEOFF]
Lloh8:
	str	w8, [x9]
LBB0_2:
	mov	w0, #-1
	b	LBB0_9
LBB0_3:
	mov	x19, x2
	mov	x21, x1
	ldr	x9, [x2]
	cmp	x9, x1
	b.hs	LBB0_8
; %bb.4:
	mov	x20, x0
	cmp	x8, x21
	b.eq	LBB0_6
; %bb.5:
	mov	x0, x21
	bl	_p2roundup
	mov	x21, x0
LBB0_6:
	ldr	x0, [x20]
	mov	x1, x21
	bl	_realloc
	cbz	x0, LBB0_2
; %bb.7:
	mov	x8, x0
	mov	w0, #0
	str	x21, [x19]
	str	x8, [x20]
	b	LBB0_9
LBB0_8:
	mov	w0, #0
LBB0_9:
	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
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotStr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.cfi_endproc
                                        ; -- End function
	.comm	_SSIZE_MAX,8,3                  ; @SSIZE_MAX
	.comm	_EOVERFLOW,4,2                  ; @EOVERFLOW
	.comm	_errno,4,2                      ; @errno
	.no_dead_strip	_expandtofit
.subsections_via_symbols
