	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function runtimecap
_runtimecap:                            ## @runtimecap
	.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	$72, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%r9d, -44(%rbp)                 ## 4-byte Spill
	movq	%r8, %r12
	movq	%rcx, %r13
	movq	%rdx, -56(%rbp)                 ## 8-byte Spill
	movq	%rsi, %rbx
	movq	%rdi, %r15
	movq	%rsi, %rdi
	callq	_findopen
	movq	%rax, %r14
	movq	%rax, %rdi
	callq	_captype
	movq	_Cruntime@GOTPCREL(%rip), %rcx
	xorl	%edi, %edi
	cmpq	(%rcx), %rax
	sete	%dil
	callq	_assert
	movq	_Cclose@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 8(%rbx)
	movq	%r12, (%rbx)
	movq	-56(%rbp), %rax                 ## 8-byte Reload
	movq	%rax, -64(%rbp)
	movq	%r14, -72(%rbp)
	movq	%r15, -80(%rbp)
	movq	%r13, -104(%rbp)
	movq	$0, -88(%rbp)
	movl	-44(%rbp), %eax                 ## 4-byte Reload
	movl	%eax, -96(%rbp)
	leaq	L_.str(%rip), %rdx
	movq	%r15, %rdi
	movl	$4, %esi
	callq	_luaL_checkstack
	leaq	-104(%rbp), %rdi
	callq	_pushluaval
	movq	_SUBJIDX@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r15, %rdi
	callq	_lua_pushvalue
	subl	%r13d, %r12d
	incl	%r12d
	movq	%r15, %rdi
	movl	%r12d, %esi
	callq	_lua_pushinteger
	leaq	-104(%rbp), %rdi
	xorl	%esi, %esi
	callq	_pushallcaptures
                                        ## kill: def $eax killed $eax def $rax
	leal	2(%rax), %esi
	movq	_LUA_MULTRET@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%r15, %rdi
	callq	_lua_call
	subq	%r14, %rbx
	shrq	$4, %rbx
	movl	%ebx, %eax
	addq	$72, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_Cruntime,8,3                   ## @Cruntime
	.comm	_Cclose,4,2                     ## @Cclose
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"too many runtime captures"

	.comm	_SUBJIDX,4,2                    ## @SUBJIDX
	.comm	_LUA_MULTRET,4,2                ## @LUA_MULTRET
	.no_dead_strip	_runtimecap
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function runtimecap
_runtimecap:                            ; @runtimecap
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #128
	.cfi_def_cfa_offset 128
	stp	x26, x25, [sp, #48]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #64]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #80]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #96]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #112]            ; 16-byte Folded Spill
	add	x29, sp, #112
	.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
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	mov	x22, x5
	mov	x23, x4
	mov	x24, x3
	mov	x25, x2
	mov	x19, x1
	mov	x20, x0
	mov	x0, x1
	bl	_findopen
	mov	x21, x0
	bl	_captype
Lloh0:
	adrp	x8, _Cruntime@GOTPAGE
Lloh1:
	ldr	x8, [x8, _Cruntime@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	cmp	x0, x8
	cset	w0, eq
	bl	_assert
Lloh3:
	adrp	x8, _Cclose@GOTPAGE
Lloh4:
	ldr	x8, [x8, _Cclose@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
	str	w8, [x19, #8]
	str	x23, [x19]
	stp	x21, x25, [sp, #32]
	str	x24, [sp]
	stp	xzr, x20, [sp, #16]
	str	w22, [sp, #8]
Lloh6:
	adrp	x2, l_.str@PAGE
Lloh7:
	add	x2, x2, l_.str@PAGEOFF
	mov	x0, x20
	mov	w1, #4
	bl	_luaL_checkstack
	mov	x0, sp
	bl	_pushluaval
Lloh8:
	adrp	x8, _SUBJIDX@GOTPAGE
Lloh9:
	ldr	x8, [x8, _SUBJIDX@GOTPAGEOFF]
Lloh10:
	ldr	w1, [x8]
	mov	x0, x20
	bl	_lua_pushvalue
	sub	w8, w23, w24
	add	w1, w8, #1
	mov	x0, x20
	bl	_lua_pushinteger
	mov	x0, sp
	mov	w1, #0
	bl	_pushallcaptures
	add	w1, w0, #2
Lloh11:
	adrp	x8, _LUA_MULTRET@GOTPAGE
Lloh12:
	ldr	x8, [x8, _LUA_MULTRET@GOTPAGEOFF]
Lloh13:
	ldr	w2, [x8]
	mov	x0, x20
	bl	_lua_call
	sub	x8, x19, x21
	lsr	x0, x8, #4
                                        ; kill: def $w0 killed $w0 killed $x0
	ldp	x29, x30, [sp, #112]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #96]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #80]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #64]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #48]             ; 16-byte Folded Reload
	add	sp, sp, #128
	ret
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.cfi_endproc
                                        ; -- End function
	.comm	_Cruntime,8,3                   ; @Cruntime
	.comm	_Cclose,4,2                     ; @Cclose
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"too many runtime captures"

	.comm	_SUBJIDX,4,2                    ; @SUBJIDX
	.comm	_LUA_MULTRET,4,2                ; @LUA_MULTRET
	.no_dead_strip	_runtimecap
.subsections_via_symbols
