	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function terminal_alloc_buffer
_terminal_alloc_buffer:                 ## @terminal_alloc_buffer
	.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	%rbx
	pushq	%rax
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r15
	movslq	(%rdi), %rdi
	incq	%rdi
	movl	$8, %esi
	callq	_el_calloc
	testq	%rax, %rax
	je	LBB0_11
## %bb.1:
	movq	%rax, %r14
	movl	(%r15), %eax
	testl	%eax, %eax
	jle	LBB0_5
## %bb.2:
	xorl	%ebx, %ebx
	.p2align	4, 0x90
LBB0_3:                                 ## =>This Inner Loop Header: Depth=1
	movq	8(%r15), %rdi
	incq	%rdi
	movl	$8, %esi
	callq	_el_calloc
	movq	%rax, (%r14,%rbx,8)
	testq	%rax, %rax
	je	LBB0_7
## %bb.4:                               ##   in Loop: Header=BB0_3 Depth=1
	incq	%rbx
	movslq	(%r15), %rax
	cmpq	%rax, %rbx
	jl	LBB0_3
LBB0_5:
	cltq
	movq	$0, (%r14,%rax,8)
	jmp	LBB0_12
LBB0_7:
	testl	%ebx, %ebx
	je	LBB0_10
## %bb.8:
	incq	%rbx
	.p2align	4, 0x90
LBB0_9:                                 ## =>This Inner Loop Header: Depth=1
	movq	-16(%r14,%rbx,8), %rdi
	callq	_el_free
	decq	%rbx
	cmpq	$1, %rbx
	jg	LBB0_9
LBB0_10:
	movq	%r14, %rdi
	callq	_el_free
LBB0_11:
	xorl	%r14d, %r14d
LBB0_12:
	movq	%r14, %rax
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.no_dead_strip	_terminal_alloc_buffer
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function terminal_alloc_buffer
_terminal_alloc_buffer:                 ; @terminal_alloc_buffer
	.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, x0
	ldrsw	x8, [x0]
	add	x0, x8, #1
	mov	w1, #8
	bl	_el_calloc
	mov	x19, x0
	cbz	x0, LBB0_10
; %bb.1:
	ldr	w8, [x20]
	cmp	w8, #1
	b.lt	LBB0_5
; %bb.2:
	mov	x21, #0
LBB0_3:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x8, [x20, #8]
	add	x0, x8, #1
	mov	w1, #8
	bl	_el_calloc
	str	x0, [x19, x21, lsl #3]
	cbz	x0, LBB0_6
; %bb.4:                                ;   in Loop: Header=BB0_3 Depth=1
	add	x21, x21, #1
	ldrsw	x8, [x20]
	cmp	x21, x8
	b.lt	LBB0_3
LBB0_5:
	str	xzr, [x19, w8, sxtw #3]
	b	LBB0_10
LBB0_6:
	cbz	w21, LBB0_9
; %bb.7:
	sub	x20, x21, #1
LBB0_8:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x0, [x19, x20, lsl #3]
	bl	_el_free
	add	x8, x20, #1
	sub	x20, x20, #1
	cmp	x8, #1
	b.gt	LBB0_8
LBB0_9:
	mov	x0, x19
	bl	_el_free
	mov	x19, #0
LBB0_10:
	mov	x0, x19
	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	_terminal_alloc_buffer
.subsections_via_symbols
