	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function substcap
_substcap:                              ## @substcap
	.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	%r13
	pushq	%r12
	pushq	%rbx
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r12
	movq	(%rdi), %rax
	movq	-8(%rax), %rbx
	movl	8(%rdi), %edi
	leaq	-44(%rbp), %rsi
	callq	_luaL_buffinit
	movq	(%r12), %rdi
	callq	_isclosecap
	testl	%eax, %eax
	je	LBB0_2
## %bb.1:
	movq	%rbx, %r13
LBB0_13:
	movq	(%r12), %rax
	movl	(%rax), %edx
	subl	%r13d, %edx
	leaq	-44(%rbp), %rbx
	movq	%rbx, %rdi
	movq	%r13, %rsi
	callq	_luaL_addlstring
	movq	%rbx, %rdi
	callq	_luaL_pushresult
	addq	$8, (%r12)
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_2:
	leaq	-44(%rbp), %r14
	movq	_Cstring@GOTPCREL(%rip), %r15
	jmp	LBB0_3
	.p2align	4, 0x90
LBB0_4:                                 ##   in Loop: Header=BB0_3 Depth=1
	movq	%r14, %rdi
	movq	%r12, %rsi
	callq	_stringcap
LBB0_11:                                ##   in Loop: Header=BB0_3 Depth=1
	movq	(%r12), %rdi
	addq	$-8, %rdi
	callq	_closeaddr
	movq	%rax, %r13
LBB0_12:                                ##   in Loop: Header=BB0_3 Depth=1
	movq	(%r12), %rdi
	callq	_isclosecap
	movq	%r13, %rbx
	testl	%eax, %eax
	jne	LBB0_13
LBB0_3:                                 ## =>This Inner Loop Header: Depth=1
	movq	(%r12), %rax
	movq	(%rax), %r13
	movl	%r13d, %edx
	subl	%ebx, %edx
	movq	%r14, %rdi
	movq	%rbx, %rsi
	callq	_luaL_addlstring
	movq	(%r12), %rdi
	callq	_captype
	cmpq	(%r15), %rax
	je	LBB0_4
## %bb.5:                               ##   in Loop: Header=BB0_3 Depth=1
	movq	%r12, %rdi
	callq	_pushcapture
	testl	%eax, %eax
	je	LBB0_12
## %bb.6:                               ##   in Loop: Header=BB0_3 Depth=1
	cmpl	$2, %eax
	jl	LBB0_8
## %bb.7:                               ##   in Loop: Header=BB0_3 Depth=1
	movl	8(%r12), %edi
	decl	%eax
	movl	%eax, %esi
	callq	_lua_pop
LBB0_8:                                 ##   in Loop: Header=BB0_3 Depth=1
	movl	8(%r12), %edi
	movl	$-1, %esi
	callq	_lua_isstring
	testl	%eax, %eax
	jne	LBB0_10
## %bb.9:                               ##   in Loop: Header=BB0_3 Depth=1
	movl	8(%r12), %ebx
	movl	%ebx, %edi
	movl	$-1, %esi
	callq	_luaL_typename
	movl	%ebx, %edi
	leaq	L_.str(%rip), %rsi
	movl	%eax, %edx
	callq	_luaL_error
LBB0_10:                                ##   in Loop: Header=BB0_3 Depth=1
	movq	%r14, %rdi
	callq	_luaL_addvalue
	jmp	LBB0_11
	.cfi_endproc
                                        ## -- End function
	.comm	_Cstring,8,3                    ## @Cstring
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"invalid replacement value (a %s)"

	.no_dead_strip	_substcap
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function substcap
_substcap:                              ; @substcap
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #80
	.cfi_def_cfa_offset 80
	stp	x24, x23, [sp, #16]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #32]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #48]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #64]             ; 16-byte Folded Spill
	add	x29, sp, #64
	.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
	mov	x19, x0
	ldr	x8, [x0]
	ldur	x21, [x8, #-8]
	ldr	w0, [x0, #8]
	add	x1, sp, #12
	bl	_luaL_buffinit
	ldr	x0, [x19]
	bl	_isclosecap
	cbz	w0, LBB0_2
LBB0_1:
	ldr	x8, [x19]
	ldr	w8, [x8]
	sub	w2, w8, w21
	add	x0, sp, #12
	mov	x1, x21
	bl	_luaL_addlstring
	add	x0, sp, #12
	bl	_luaL_pushresult
	ldr	x8, [x19]
	add	x8, x8, #8
	str	x8, [x19]
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #80
	ret
LBB0_2:
Lloh0:
	adrp	x22, _Cstring@GOTPAGE
Lloh1:
	ldr	x22, [x22, _Cstring@GOTPAGEOFF]
Lloh2:
	adrp	x20, l_.str@PAGE
Lloh3:
	add	x20, x20, l_.str@PAGEOFF
	b	LBB0_6
LBB0_3:                                 ;   in Loop: Header=BB0_6 Depth=1
	add	x0, sp, #12
	mov	x1, x19
	bl	_stringcap
LBB0_4:                                 ;   in Loop: Header=BB0_6 Depth=1
	ldr	x8, [x19]
	sub	x0, x8, #8
	bl	_closeaddr
	mov	x21, x0
LBB0_5:                                 ;   in Loop: Header=BB0_6 Depth=1
	ldr	x0, [x19]
	bl	_isclosecap
	cbnz	w0, LBB0_1
LBB0_6:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x8, [x19]
	ldr	x23, [x8]
	sub	w2, w23, w21
	add	x0, sp, #12
	mov	x1, x21
	bl	_luaL_addlstring
	ldr	x0, [x19]
	bl	_captype
	ldr	x8, [x22]
	cmp	x0, x8
	b.eq	LBB0_3
; %bb.7:                                ;   in Loop: Header=BB0_6 Depth=1
	mov	x0, x19
	bl	_pushcapture
	cbz	w0, LBB0_13
; %bb.8:                                ;   in Loop: Header=BB0_6 Depth=1
	cmp	w0, #2
	b.lt	LBB0_10
; %bb.9:                                ;   in Loop: Header=BB0_6 Depth=1
	ldr	w8, [x19, #8]
	sub	w1, w0, #1
	mov	x0, x8
	bl	_lua_pop
LBB0_10:                                ;   in Loop: Header=BB0_6 Depth=1
	ldr	w0, [x19, #8]
	mov	w1, #-1
	bl	_lua_isstring
	cbnz	w0, LBB0_12
; %bb.11:                               ;   in Loop: Header=BB0_6 Depth=1
	ldr	w21, [x19, #8]
	mov	x0, x21
	mov	w1, #-1
	bl	_luaL_typename
	mov	x2, x0
	mov	x0, x21
	mov	x1, x20
	bl	_luaL_error
LBB0_12:                                ;   in Loop: Header=BB0_6 Depth=1
	add	x0, sp, #12
	bl	_luaL_addvalue
	b	LBB0_4
LBB0_13:                                ;   in Loop: Header=BB0_6 Depth=1
	mov	x21, x23
	b	LBB0_5
	.loh AdrpAdd	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.cfi_endproc
                                        ; -- End function
	.comm	_Cstring,8,3                    ; @Cstring
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"invalid replacement value (a %s)"

	.no_dead_strip	_substcap
.subsections_via_symbols
