	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function lastlevel
_lastlevel:                             ## @lastlevel
	.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, %r14
	movl	$1, %ecx
	leaq	-44(%rbp), %rbx
	movl	$1, %r12d
	.p2align	4, 0x90
LBB0_1:                                 ## =>This Inner Loop Header: Depth=1
	movl	%r12d, %r13d
	movl	%ecx, %r12d
	movq	%r14, %rdi
	movl	%ecx, %esi
	movq	%rbx, %rdx
	callq	_lua_getstack
	leal	(%r12,%r12), %ecx
	testq	%rax, %rax
	jne	LBB0_1
## %bb.2:
	cmpl	%r12d, %r13d
	jge	LBB0_8
## %bb.3:
	leaq	-44(%rbp), %r15
	jmp	LBB0_4
	.p2align	4, 0x90
LBB0_6:                                 ##   in Loop: Header=BB0_4 Depth=1
	incl	%ebx
	movl	%ebx, %r13d
	cmpl	%r12d, %r13d
	jge	LBB0_8
LBB0_4:                                 ## =>This Inner Loop Header: Depth=1
	leal	(%r12,%r13), %eax
	movl	%eax, %ebx
	shrl	$31, %ebx
	addl	%eax, %ebx
	sarl	%ebx
	movq	%r14, %rdi
	movl	%ebx, %esi
	movq	%r15, %rdx
	callq	_lua_getstack
	testq	%rax, %rax
	jne	LBB0_6
## %bb.5:                               ##   in Loop: Header=BB0_4 Depth=1
	movl	%ebx, %r12d
	cmpl	%r12d, %r13d
	jl	LBB0_4
LBB0_8:
	decl	%r12d
	movl	%r12d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.no_dead_strip	_lastlevel
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function lastlevel
_lastlevel:                             ; @lastlevel
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #64
	.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
	mov	x19, x0
	mov	w8, #1
	mov	w20, #1
LBB0_1:                                 ; =>This Inner Loop Header: Depth=1
	mov	x22, x20
	mov	x20, x8
	add	x2, sp, #12
	mov	x0, x19
	mov	x1, x8
	bl	_lua_getstack
	lsl	w8, w20, #1
	cbnz	x0, LBB0_1
	b	LBB0_3
LBB0_2:                                 ;   in Loop: Header=BB0_3 Depth=1
	add	w8, w22, w20
	cmp	w8, #0
	cinc	w8, w8, lt
	asr	w21, w8, #1
	add	x2, sp, #12
	mov	x0, x19
	mov	x1, x21
	bl	_lua_getstack
	cmp	x0, #0
	csel	w20, w21, w20, eq
	csinc	w22, w22, w21, eq
LBB0_3:                                 ; =>This Inner Loop Header: Depth=1
	cmp	w22, w20
	b.lt	LBB0_2
; %bb.4:
	sub	w0, w20, #1
	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
	add	sp, sp, #64
	ret
	.cfi_endproc
                                        ; -- End function
	.no_dead_strip	_lastlevel
.subsections_via_symbols
