	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function lua_settop
_lua_settop:                            ## @lua_settop
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%r14
	pushq	%rbx
	.cfi_offset %rbx, -32
	.cfi_offset %r14, -24
	movl	%esi, %r14d
	movq	%rdi, %rbx
	testl	%esi, %esi
	js	LBB0_4
## %bb.1:
	movl	(%rbx), %eax
	subl	4(%rbx), %eax
	xorl	%esi, %esi
	cmpl	%r14d, %eax
	setge	%sil
	movq	%rbx, %rdi
	callq	_luai_apicheck
	movq	8(%rbx), %rdi
	movslq	4(%rbx), %rax
	movslq	%r14d, %r14
	.p2align	4, 0x90
LBB0_3:                                 ## =>This Inner Loop Header: Depth=1
	addq	%r14, %rax
	cmpq	%rax, %rdi
	jge	LBB0_5
## %bb.2:                               ##   in Loop: Header=BB0_3 Depth=1
	leaq	1(%rdi), %rax
	movq	%rax, 8(%rbx)
                                        ## kill: def $edi killed $edi killed $rdi
	callq	_setnilvalue
	movq	8(%rbx), %rdi
	movslq	4(%rbx), %rax
	jmp	LBB0_3
LBB0_4:
	movl	%r14d, %eax
	notl	%eax
	movq	8(%rbx), %rcx
	movslq	4(%rbx), %rdx
	subq	%rdx, %rcx
	xorl	%esi, %esi
	cmpq	%rax, %rcx
	setge	%sil
	movq	%rbx, %rdi
	callq	_luai_apicheck
	movslq	%r14d, %rax
	movq	8(%rbx), %rcx
	addq	%rcx, %rax
	incq	%rax
LBB0_5:
	movq	%rax, 8(%rbx)
	popq	%rbx
	popq	%r14
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.no_dead_strip	_lua_settop
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function lua_settop
_lua_settop:                            ; @lua_settop
	.cfi_startproc
; %bb.0:
	stp	x22, x21, [sp, #-48]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 48
	stp	x20, x19, [sp, #16]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #32]             ; 16-byte Folded Spill
	add	x29, sp, #32
	.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	x20, x1
	mov	x19, x0
	tbnz	w1, #31, LBB0_4
; %bb.1:
	ldp	w8, w9, [x19]
	sub	w8, w8, w9
	cmp	w8, w20
	cset	w1, ge
	mov	x0, x19
	bl	_luai_apicheck
LBB0_2:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x0, [x19, #8]
	ldrsw	x8, [x19, #4]
	add	x8, x8, w20, sxtw
	cmp	x0, x8
	b.ge	LBB0_5
; %bb.3:                                ;   in Loop: Header=BB0_2 Depth=1
	add	x8, x0, #1
	str	x8, [x19, #8]
                                        ; kill: def $w0 killed $w0 killed $x0
	bl	_setnilvalue
	b	LBB0_2
LBB0_4:
	add	w21, w20, #1
	mvn	w8, w20
	ldr	x9, [x19, #8]
	ldrsw	x10, [x19, #4]
	sub	x9, x9, x10
	cmp	x9, x8
	cset	w1, ge
	mov	x0, x19
	bl	_luai_apicheck
	ldr	x8, [x19, #8]
	add	x8, x8, w21, sxtw
LBB0_5:
	str	x8, [x19, #8]
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	ret
	.cfi_endproc
                                        ; -- End function
	.no_dead_strip	_lua_settop
.subsections_via_symbols
