	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function getcaptures
_getcaptures:                           ## @getcaptures
	.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
	subq	$56, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%ecx, %r13d
	movq	%rdx, %r12
	movq	%rsi, %r15
	movq	%rdi, %r14
	movl	%ecx, %edi
	callq	_caplistidx
	movq	%r14, %rdi
	movl	%eax, %esi
	callq	_lua_touserdata
	movq	%rax, %rbx
	movq	%rax, %rdi
	callq	_isclosecap
	testl	%eax, %eax
	jne	LBB0_4
## %bb.1:
	movq	%rbx, -72(%rbp)
	movq	%rbx, -48(%rbp)
	movq	%r14, -56(%rbp)
	movq	%r15, -88(%rbp)
	movq	$0, -64(%rbp)
	movl	%r13d, -80(%rbp)
	xorl	%ebx, %ebx
	leaq	-88(%rbp), %r13
	.p2align	4, 0x90
LBB0_2:                                 ## =>This Inner Loop Header: Depth=1
	movq	%r13, %rdi
	callq	_pushcapture
	movslq	%ebx, %rbx
	addq	%rax, %rbx
	movq	-72(%rbp), %rdi
	callq	_isclosecap
	testl	%eax, %eax
	je	LBB0_2
## %bb.3:
	testl	%ebx, %ebx
	jne	LBB0_5
LBB0_4:
	subl	%r15d, %r12d
	incl	%r12d
	movq	%r14, %rdi
	movl	%r12d, %esi
	callq	_lua_pushinteger
	movl	$1, %ebx
LBB0_5:
	movl	%ebx, %eax
	addq	$56, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.no_dead_strip	_getcaptures
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function getcaptures
_getcaptures:                           ; @getcaptures
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #112
	.cfi_def_cfa_offset 112
	stp	x24, x23, [sp, #48]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #64]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #80]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #96]             ; 16-byte Folded Spill
	add	x29, sp, #96
	.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	x23, x3
	mov	x20, x2
	mov	x21, x1
	mov	x19, x0
	mov	x0, x3
	bl	_caplistidx
	mov	x1, x0
	mov	x0, x19
	bl	_lua_touserdata
	mov	x24, x0
	bl	_isclosecap
	cbnz	w0, LBB0_4
; %bb.1:
	mov	x22, #0
	stp	x19, x24, [sp, #32]
	str	x21, [sp]
	stp	x24, xzr, [sp, #16]
	str	w23, [sp, #8]
LBB0_2:                                 ; =>This Inner Loop Header: Depth=1
	mov	x0, sp
	bl	_pushcapture
	add	x22, x0, w22, sxtw
	ldr	x0, [sp, #16]
	bl	_isclosecap
	cbz	w0, LBB0_2
; %bb.3:
	cbnz	w22, LBB0_5
LBB0_4:
	sub	w8, w20, w21
	add	w1, w8, #1
	mov	x0, x19
	bl	_lua_pushinteger
	mov	w22, #1
LBB0_5:
	mov	x0, x22
	ldp	x29, x30, [sp, #96]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #80]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #64]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #48]             ; 16-byte Folded Reload
	add	sp, sp, #112
	ret
	.cfi_endproc
                                        ; -- End function
	.no_dead_strip	_getcaptures
.subsections_via_symbols
