	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function NIAddSpell
_NIAddSpell:                            ## @NIAddSpell
	.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	%rdx, %r14
	movq	%rsi, %r15
	movq	%rdi, %rbx
	movl	4(%rdi), %esi
	cmpl	%esi, (%rdi)
	jl	LBB0_5
## %bb.1:
	testl	%esi, %esi
	je	LBB0_3
## %bb.2:
	leal	(%rsi,%rsi), %eax
	movl	%eax, 4(%rbx)
	movq	8(%rbx), %rdi
	shll	$4, %esi
                                        ## kill: def $esi killed $esi killed $rsi
	callq	_repalloc
	jmp	LBB0_4
LBB0_3:
	movl	$20480, 4(%rbx)                 ## imm = 0x5000
	movl	$163840, %edi                   ## imm = 0x28000
	callq	_tmpalloc
LBB0_4:
	movq	%rax, 8(%rbx)
LBB0_5:
	movq	_SPELLHDRSZ@GOTPCREL(%rip), %rax
	movl	(%rax), %r12d
	movq	%r15, %rdi
	callq	_strlen
                                        ## kill: def $eax killed $eax def $rax
	leal	(%r12,%rax), %edi
	incl	%edi
	callq	_tmpalloc
	movq	8(%rbx), %rcx
	movslq	(%rbx), %rdx
	movq	%rax, (%rcx,%rdx,8)
	movq	8(%rbx), %rax
	movq	(%rax,%rdx,8), %rax
	movl	4(%rax), %edi
	movq	%r15, %rsi
	callq	_strcpy
	cmpb	$0, (%r14)
	je	LBB0_7
## %bb.6:
	movq	%rbx, %rdi
	movq	%r14, %rsi
	callq	_cpstrdup
	jmp	LBB0_8
LBB0_7:
	movq	_VoidString@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
LBB0_8:
	movq	8(%rbx), %rcx
	movslq	(%rbx), %rdx
	movq	(%rcx,%rdx,8), %rcx
	movl	%eax, (%rcx)
	leal	1(%rdx), %eax
	movl	%eax, (%rbx)
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_SPELLHDRSZ,4,2                 ## @SPELLHDRSZ
	.comm	_VoidString,4,2                 ## @VoidString
	.no_dead_strip	_NIAddSpell
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function NIAddSpell
_NIAddSpell:                            ; @NIAddSpell
	.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	x21, x1
	mov	x19, x0
	ldp	w9, w8, [x0]
	cmp	w9, w8
	b.lt	LBB0_5
; %bb.1:
	cbz	w8, LBB0_3
; %bb.2:
	lsl	w9, w8, #1
	str	w9, [x19, #4]
	ldr	x0, [x19, #8]
	lsl	w1, w8, #4
	bl	_repalloc
	b	LBB0_4
LBB0_3:
	mov	w8, #20480
	str	w8, [x19, #4]
	mov	w0, #32768
	movk	w0, #2, lsl #16
	bl	_tmpalloc
LBB0_4:
	str	x0, [x19, #8]
LBB0_5:
Lloh0:
	adrp	x8, _SPELLHDRSZ@GOTPAGE
Lloh1:
	ldr	x8, [x8, _SPELLHDRSZ@GOTPAGEOFF]
Lloh2:
	ldr	w22, [x8]
	mov	x0, x21
	bl	_strlen
	add	w8, w22, w0
	add	w0, w8, #1
	bl	_tmpalloc
	ldr	x8, [x19, #8]
	ldrsw	x9, [x19]
	lsl	x9, x9, #3
	str	x0, [x8, x9]
	ldr	x8, [x19, #8]
	ldr	x8, [x8, x9]
	ldr	w0, [x8, #4]
	mov	x1, x21
	bl	_strcpy
	ldrb	w8, [x20]
	cbz	w8, LBB0_7
; %bb.6:
	mov	x0, x19
	mov	x1, x20
	bl	_cpstrdup
	b	LBB0_8
LBB0_7:
Lloh3:
	adrp	x8, _VoidString@GOTPAGE
Lloh4:
	ldr	x8, [x8, _VoidString@GOTPAGEOFF]
Lloh5:
	ldr	w0, [x8]
LBB0_8:
	ldr	x8, [x19, #8]
	ldrsw	x9, [x19]
	ldr	x8, [x8, x9, lsl #3]
	str	w0, [x8]
	add	w8, w9, #1
	str	w8, [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
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.cfi_endproc
                                        ; -- End function
	.comm	_SPELLHDRSZ,4,2                 ; @SPELLHDRSZ
	.comm	_VoidString,4,2                 ; @VoidString
	.no_dead_strip	_NIAddSpell
.subsections_via_symbols
