	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function getstrcaps
_getstrcaps:                            ## @getstrcaps
	.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
	movl	%edx, %r15d
	movq	%rsi, %r14
	movq	%rdi, %rbx
	movq	_MAXSTRCAPS@GOTPCREL(%rip), %r13
	movq	(%rdi), %rdi
	cmpl	%edx, (%r13)
	jle	LBB0_2
## %bb.1:
	movl	(%rdi), %eax
	movslq	%r15d, %rcx
	movl	%eax, 4(%r14,%rcx,8)
LBB0_2:
	leal	1(%r15), %r12d
	leaq	4(%rdi), %rax
	movq	%rax, (%rbx)
                                        ## kill: def $edi killed $edi killed $rdi
	callq	_isfullcap
	testl	%eax, %eax
	je	LBB0_3
## %bb.8:
	cmpl	%r15d, (%r13)
	jle	LBB0_10
LBB0_9:
	movq	(%rbx), %rdi
	addq	$-4, %rdi
	callq	_closeaddr
	movslq	%r15d, %rcx
	movl	%eax, (%r14,%rcx,8)
LBB0_10:
	movl	%r12d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_3:
	movq	(%rbx), %rdi
	callq	_isclosecap
	testl	%eax, %eax
	jne	LBB0_7
## %bb.4:
	movq	_Csimple@GOTPCREL(%rip), %r13
	.p2align	4, 0x90
LBB0_5:                                 ## =>This Inner Loop Header: Depth=1
	movq	(%rbx), %rdi
	callq	_captype
	cmpq	(%r13), %rax
	jne	LBB0_11
## %bb.6:                               ##   in Loop: Header=BB0_5 Depth=1
	movq	%rbx, %rdi
	movq	%r14, %rsi
	movl	%r12d, %edx
	callq	_getstrcaps
	movl	%eax, %r12d
	movq	(%rbx), %rdi
	callq	_isclosecap
	testl	%eax, %eax
	je	LBB0_5
LBB0_7:
	addq	$4, (%rbx)
	movq	_MAXSTRCAPS@GOTPCREL(%rip), %r13
	cmpl	%r15d, (%r13)
	jg	LBB0_9
	jmp	LBB0_10
LBB0_11:
	movl	8(%rbx), %edi
	leaq	L_.str(%rip), %rsi
	movl	%r12d, %edx
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_luaL_error                     ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_MAXSTRCAPS,4,2                 ## @MAXSTRCAPS
	.comm	_Csimple,8,3                    ## @Csimple
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"invalid capture #%d in replacement pattern"

	.no_dead_strip	_getstrcaps
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function getstrcaps
_getstrcaps:                            ; @getstrcaps
	.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
	mov	x21, x2
	mov	x20, x1
	mov	x22, x0
	add	w19, w2, #1
Lloh0:
	adrp	x23, _MAXSTRCAPS@GOTPAGE
Lloh1:
	ldr	x23, [x23, _MAXSTRCAPS@GOTPAGEOFF]
	ldr	w8, [x23]
	ldr	x0, [x0]
	cmp	w8, w2
	b.le	LBB0_2
; %bb.1:
	ldr	w8, [x0]
	add	x9, x20, w21, sxtw #3
	str	w8, [x9, #4]
LBB0_2:
	add	x8, x0, #4
	str	x8, [x22]
                                        ; kill: def $w0 killed $w0 killed $x0
	bl	_isfullcap
	cbnz	w0, LBB0_8
; %bb.3:
	ldr	x0, [x22]
	bl	_isclosecap
	cbnz	w0, LBB0_7
; %bb.4:
Lloh2:
	adrp	x24, _Csimple@GOTPAGE
Lloh3:
	ldr	x24, [x24, _Csimple@GOTPAGEOFF]
LBB0_5:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x0, [x22]
	bl	_captype
	ldr	x8, [x24]
	cmp	x0, x8
	b.ne	LBB0_11
; %bb.6:                                ;   in Loop: Header=BB0_5 Depth=1
	mov	x0, x22
	mov	x1, x20
	mov	x2, x19
	bl	_getstrcaps
	mov	x19, x0
	ldr	x0, [x22]
	bl	_isclosecap
	cbz	w0, LBB0_5
LBB0_7:
	ldr	x8, [x22]
	add	x8, x8, #4
	str	x8, [x22]
LBB0_8:
	ldr	w8, [x23]
	cmp	w8, w21
	b.le	LBB0_10
; %bb.9:
	ldr	x8, [x22]
	sub	x0, x8, #4
	bl	_closeaddr
	sbfiz	x8, x21, #3, #32
	str	w0, [x20, x8]
LBB0_10:
	mov	x0, x19
	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
LBB0_11:
	ldr	w0, [x22, #8]
Lloh4:
	adrp	x1, l_.str@PAGE
Lloh5:
	add	x1, x1, l_.str@PAGEOFF
	mov	x2, x19
	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
	b	_luaL_error
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpAdd	Lloh4, Lloh5
	.cfi_endproc
                                        ; -- End function
	.comm	_MAXSTRCAPS,4,2                 ; @MAXSTRCAPS
	.comm	_Csimple,8,3                    ; @Csimple
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"invalid capture #%d in replacement pattern"

	.no_dead_strip	_getstrcaps
.subsections_via_symbols
