	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function tremove
_tremove:                               ## @tremove
	.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	%r12
	pushq	%rbx
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r14
	movq	_TAB_RW@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movl	$1, %esi
	callq	_aux_getn
	movl	%eax, %r15d
	movq	%r14, %rdi
	movl	$2, %esi
	movl	%eax, %edx
	callq	_luaL_optinteger
	movl	%eax, %r12d
	cmpl	%r15d, %eax
	je	LBB0_2
## %bb.1:
	testl	%r12d, %r12d
	setg	%al
	leal	1(%r15), %ecx
	cmpl	%ecx, %r12d
	setle	%cl
	andb	%al, %cl
	movzbl	%cl, %esi
	leaq	L_.str(%rip), %rcx
	movq	%r14, %rdi
	movl	$1, %edx
	callq	_luaL_argcheck
LBB0_2:
	movq	%r14, %rdi
	movl	$1, %esi
	movl	%r12d, %edx
	callq	_lua_geti
	cmpl	%r15d, %r12d
	jge	LBB0_5
	.p2align	4, 0x90
LBB0_3:                                 ## =>This Inner Loop Header: Depth=1
	leal	1(%r12), %ebx
	movq	%r14, %rdi
	movl	$1, %esi
	movl	%ebx, %edx
	callq	_lua_geti
	movq	%r14, %rdi
	movl	$1, %esi
	movl	%r12d, %edx
	callq	_lua_seti
	movl	%ebx, %r12d
	cmpl	%ebx, %r15d
	jne	LBB0_3
## %bb.4:
	movl	%r15d, %r12d
LBB0_5:
	movq	%r14, %rdi
	callq	_lua_pushnil
	movq	%r14, %rdi
	movl	$1, %esi
	movl	%r12d, %edx
	callq	_lua_seti
	movl	$1, %eax
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_TAB_RW,4,2                     ## @TAB_RW
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"position out of bounds"

	.no_dead_strip	_tremove
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function tremove
_tremove:                               ; @tremove
	.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	x19, x0
Lloh0:
	adrp	x8, _TAB_RW@GOTPAGE
Lloh1:
	ldr	x8, [x8, _TAB_RW@GOTPAGEOFF]
Lloh2:
	ldr	w2, [x8]
	mov	w1, #1
	bl	_aux_getn
	mov	x21, x0
	mov	x0, x19
	mov	w1, #2
	mov	x2, x21
	bl	_luaL_optinteger
	mov	x20, x0
	cmp	w0, w21
	b.eq	LBB0_2
; %bb.1:
	cmp	w20, #0
	add	w8, w21, #1
	ccmp	w20, w8, #0, gt
	cset	w1, le
Lloh3:
	adrp	x3, l_.str@PAGE
Lloh4:
	add	x3, x3, l_.str@PAGEOFF
	mov	x0, x19
	mov	w2, #1
	bl	_luaL_argcheck
LBB0_2:
	mov	x0, x19
	mov	w1, #1
	mov	x2, x20
	bl	_lua_geti
	cmp	w20, w21
	b.ge	LBB0_5
LBB0_3:                                 ; =>This Inner Loop Header: Depth=1
	add	w22, w20, #1
	mov	x0, x19
	mov	w1, #1
	mov	x2, x22
	bl	_lua_geti
	mov	x0, x19
	mov	w1, #1
	mov	x2, x20
	bl	_lua_seti
	mov	x20, x22
	cmp	w21, w22
	b.ne	LBB0_3
; %bb.4:
	mov	x20, x21
LBB0_5:
	mov	x0, x19
	bl	_lua_pushnil
	mov	x0, x19
	mov	w1, #1
	mov	x2, x20
	bl	_lua_seti
	mov	w0, #1
	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
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh3, Lloh4
	.cfi_endproc
                                        ; -- End function
	.comm	_TAB_RW,4,2                     ; @TAB_RW
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"position out of bounds"

	.no_dead_strip	_tremove
.subsections_via_symbols
