	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_newtapebuf                     ## -- Begin function newtapebuf
	.p2align	4, 0x90
_newtapebuf:                            ## @newtapebuf
	.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	_ntrec@GOTPCREL(%rip), %rax
	movq	%rdi, (%rax)
	movslq	_newtapebuf.tapebufsize(%rip), %rax
	cmpq	%rdi, %rax
	jge	LBB0_6
## %bb.1:
	movq	%rdi, %rbx
	movq	_tapebuf@GOTPCREL(%rip), %r14
	movq	(%r14), %rdi
	testq	%rdi, %rdi
	je	LBB0_3
## %bb.2:
	movq	_TP_BSIZE@GOTPCREL(%rip), %rax
	movslq	(%rax), %rax
	shlq	$2, %rax
	subq	%rax, %rdi
	callq	_free
LBB0_3:
	leaq	1(%rbx), %rdi
	movq	_TP_BSIZE@GOTPCREL(%rip), %r15
	movslq	(%r15), %r12
	imulq	%r12, %rdi
	callq	_malloc
	movq	%rax, (%r14)
	testq	%rax, %rax
	jne	LBB0_5
## %bb.4:
	movq	_stderr@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	leaq	L_.str(%rip), %rsi
	callq	_fprintf
	movl	$1, %edi
	callq	_done
	movslq	(%r15), %r12
	movq	(%r14), %rax
LBB0_5:
	leaq	(%rax,%r12,4), %rax
	movq	%rax, (%r14)
	movl	%ebx, _newtapebuf.tapebufsize(%rip)
LBB0_6:
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__DATA,__data
	.p2align	2                               ## @newtapebuf.tapebufsize
_newtapebuf.tapebufsize:
	.long	4294967295                      ## 0xffffffff

	.comm	_ntrec,8,3                      ## @ntrec
	.comm	_tapebuf,8,3                    ## @tapebuf
	.comm	_TP_BSIZE,4,2                   ## @TP_BSIZE
	.comm	_stderr,4,2                     ## @stderr
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Cannot allocate space for tape buffer\n"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_newtapebuf                     ; -- Begin function newtapebuf
	.p2align	2
_newtapebuf:                            ; @newtapebuf
	.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
Lloh0:
	adrp	x8, _ntrec@GOTPAGE
Lloh1:
	ldr	x8, [x8, _ntrec@GOTPAGEOFF]
Lloh2:
	str	x0, [x8]
	adrp	x20, _newtapebuf.tapebufsize@PAGE
	ldrsw	x8, [x20, _newtapebuf.tapebufsize@PAGEOFF]
	cmp	x8, x0
	b.ge	LBB0_6
; %bb.1:
	mov	x19, x0
Lloh3:
	adrp	x21, _tapebuf@GOTPAGE
Lloh4:
	ldr	x21, [x21, _tapebuf@GOTPAGEOFF]
	ldr	x8, [x21]
Lloh5:
	adrp	x22, _TP_BSIZE@GOTPAGE
Lloh6:
	ldr	x22, [x22, _TP_BSIZE@GOTPAGEOFF]
	cbz	x8, LBB0_3
; %bb.2:
	ldrsw	x9, [x22]
	sub	x0, x8, x9, lsl #2
	bl	_free
LBB0_3:
	ldrsw	x23, [x22]
	madd	x0, x23, x19, x23
	bl	_malloc
	str	x0, [x21]
	cbnz	x0, LBB0_5
; %bb.4:
Lloh7:
	adrp	x8, _stderr@GOTPAGE
Lloh8:
	ldr	x8, [x8, _stderr@GOTPAGEOFF]
Lloh9:
	ldr	w0, [x8]
Lloh10:
	adrp	x1, l_.str@PAGE
Lloh11:
	add	x1, x1, l_.str@PAGEOFF
	bl	_fprintf
	mov	w0, #1
	bl	_done
	ldrsw	x23, [x22]
	ldr	x0, [x21]
LBB0_5:
	add	x8, x0, x23, lsl #2
	str	x8, [x21]
	str	w19, [x20, _newtapebuf.tapebufsize@PAGEOFF]
LBB0_6:
	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
	.loh AdrpLdrGotStr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpAdd	Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.cfi_endproc
                                        ; -- End function
	.section	__DATA,__data
	.p2align	2                               ; @newtapebuf.tapebufsize
_newtapebuf.tapebufsize:
	.long	4294967295                      ; 0xffffffff

	.comm	_ntrec,8,3                      ; @ntrec
	.comm	_tapebuf,8,3                    ; @tapebuf
	.comm	_TP_BSIZE,4,2                   ; @TP_BSIZE
	.comm	_stderr,4,2                     ; @stderr
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Cannot allocate space for tape buffer\n"

.subsections_via_symbols
