	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_BG_NewString                   ## -- Begin function BG_NewString
	.p2align	4, 0x90
_BG_NewString:                          ## @BG_NewString
	.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	%rdi, %r14
	callq	_strlen
                                        ## kill: def $eax killed $eax def $rax
	movq	_bg_buffer_idx@GOTPCREL(%rip), %r12
	movl	(%r12), %ecx
	leal	(%rcx,%rax), %edx
	incl	%edx
	movl	%eax, %r15d
	incl	%r15d
	movq	_BG_BUFFERSIZE@GOTPCREL(%rip), %rax
	cmpl	(%rax), %edx
	jle	LBB0_2
## %bb.1:
	movq	_ERR_DROP@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	leaq	L_.str(%rip), %rsi
	callq	_Com_Error
	movl	(%r12), %ecx
LBB0_2:
	movq	_bg_string_buffer@GOTPCREL(%rip), %rax
	movslq	%ecx, %rbx
	addq	(%rax), %rbx
	movq	%rbx, %rdi
	movq	%r14, %rsi
	movl	%r15d, %edx
	callq	_Com_Memcpy
	addl	%r15d, (%r12)
	movq	%rbx, %rax
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_bg_buffer_idx,4,2              ## @bg_buffer_idx
	.comm	_BG_BUFFERSIZE,4,2              ## @BG_BUFFERSIZE
	.comm	_ERR_DROP,4,2                   ## @ERR_DROP
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Failed to Allocate new string!"

	.comm	_bg_string_buffer,8,3           ## @bg_string_buffer
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_BG_NewString                   ; -- Begin function BG_NewString
	.p2align	2
_BG_NewString:                          ; @BG_NewString
	.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	x19, x0
	bl	_strlen
	add	w20, w0, #1
Lloh0:
	adrp	x22, _bg_buffer_idx@GOTPAGE
Lloh1:
	ldr	x22, [x22, _bg_buffer_idx@GOTPAGEOFF]
	ldr	w8, [x22]
Lloh2:
	adrp	x9, _BG_BUFFERSIZE@GOTPAGE
Lloh3:
	ldr	x9, [x9, _BG_BUFFERSIZE@GOTPAGEOFF]
Lloh4:
	ldr	w9, [x9]
	add	w10, w8, w20
	cmp	w10, w9
	b.le	LBB0_2
; %bb.1:
Lloh5:
	adrp	x8, _ERR_DROP@GOTPAGE
Lloh6:
	ldr	x8, [x8, _ERR_DROP@GOTPAGEOFF]
Lloh7:
	ldr	w0, [x8]
Lloh8:
	adrp	x1, l_.str@PAGE
Lloh9:
	add	x1, x1, l_.str@PAGEOFF
	bl	_Com_Error
	ldr	w8, [x22]
LBB0_2:
Lloh10:
	adrp	x9, _bg_string_buffer@GOTPAGE
Lloh11:
	ldr	x9, [x9, _bg_string_buffer@GOTPAGEOFF]
Lloh12:
	ldr	x9, [x9]
	add	x21, x9, w8, sxtw
	mov	x0, x21
	mov	x1, x19
	mov	x2, x20
	bl	_Com_Memcpy
	ldr	w8, [x22]
	add	w8, w8, w20
	str	w8, [x22]
	mov	x0, x21
	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	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpAdd	Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.cfi_endproc
                                        ; -- End function
	.comm	_bg_buffer_idx,4,2              ; @bg_buffer_idx
	.comm	_BG_BUFFERSIZE,4,2              ; @BG_BUFFERSIZE
	.comm	_ERR_DROP,4,2                   ; @ERR_DROP
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Failed to Allocate new string!"

	.comm	_bg_string_buffer,8,3           ; @bg_string_buffer
.subsections_via_symbols
