	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function index2addr
_index2addr:                            ## @index2addr
	.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
	movl	%esi, %ebx
	movq	%rdi, %r14
	movq	8(%rdi), %r15
	testl	%esi, %esi
	jle	LBB0_3
## %bb.1:
	movl	%ebx, %eax
	movq	(%r15), %rcx
	movq	8(%r15), %rdx
	leaq	(%rcx,%rax,4), %rbx
	subq	%rcx, %rdx
	addq	$-4, %rdx
	sarq	$2, %rdx
	xorl	%esi, %esi
	cmpq	%rax, %rdx
	setge	%sil
	leaq	L_.str(%rip), %rdx
	movq	%r14, %rdi
	callq	_api_check
	cmpq	(%r14), %rbx
	jb	LBB0_12
LBB0_2:
	movq	_NONVALIDVALUE@GOTPCREL(%rip), %rax
	movq	(%rax), %rbx
	jmp	LBB0_12
LBB0_3:
	movl	%ebx, %edi
	callq	_ispseudo
	testl	%eax, %eax
	je	LBB0_4
## %bb.8:
	movq	_LUA_REGISTRYINDEX@GOTPCREL(%rip), %rax
	movl	(%rax), %r12d
	subl	%ebx, %r12d
	jne	LBB0_9
## %bb.13:
	movq	%r14, %rdi
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_G                              ## TAILCALL
LBB0_4:
	testl	%ebx, %ebx
	je	LBB0_5
## %bb.6:
	movl	%ebx, %eax
	negl	%eax
	movq	(%r14), %rcx
	subq	(%r15), %rcx
	addq	$-4, %rcx
	sarq	$2, %rcx
	xorl	%esi, %esi
	cmpq	%rax, %rcx
	setge	%sil
	jmp	LBB0_7
LBB0_9:
	movq	_MAXUPVAL@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	incl	%eax
	xorl	%esi, %esi
	cmpl	%eax, %r12d
	setle	%sil
	leaq	L_.str.2(%rip), %rdx
	movq	%r14, %rdi
	callq	_api_check
	movq	(%r15), %rdi
	callq	_ttislcf
	testq	%rax, %rax
	jne	LBB0_2
## %bb.10:
	movq	(%r15), %rdi
	callq	_clCvalue
	cmpl	(%rax), %r12d
	jg	LBB0_2
## %bb.11:
	movq	8(%rax), %rax
	movslq	%r12d, %rcx
	leaq	(%rax,%rcx,4), %rbx
	addq	$-4, %rbx
	jmp	LBB0_12
LBB0_5:
	xorl	%esi, %esi
LBB0_7:
	leaq	L_.str.1(%rip), %rdx
	movq	%r14, %rdi
	callq	_api_check
	movslq	%ebx, %rbx
	shlq	$2, %rbx
	addq	(%r14), %rbx
LBB0_12:
	movq	%rbx, %rax
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"unacceptable index"

	.comm	_NONVALIDVALUE,8,3              ## @NONVALIDVALUE
L_.str.1:                               ## @.str.1
	.asciz	"invalid index"

	.comm	_LUA_REGISTRYINDEX,4,2          ## @LUA_REGISTRYINDEX
	.comm	_MAXUPVAL,4,2                   ## @MAXUPVAL
L_.str.2:                               ## @.str.2
	.asciz	"upvalue index too large"

	.no_dead_strip	_index2addr
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function index2addr
_index2addr:                            ; @index2addr
	.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
	ldr	x21, [x0, #8]
	cmp	w1, #1
	b.lt	LBB0_3
; %bb.1:
	mov	w8, w20
	ldp	x9, x10, [x21]
	add	x20, x9, w20, uxtw #2
	sub	x9, x10, x9
	sub	x9, x9, #4
	cmp	x8, x9, asr #2
	cset	w1, le
Lloh0:
	adrp	x2, l_.str@PAGE
Lloh1:
	add	x2, x2, l_.str@PAGEOFF
	mov	x0, x19
	bl	_api_check
	ldr	x8, [x19]
Lloh2:
	adrp	x9, _NONVALIDVALUE@GOTPAGE
Lloh3:
	ldr	x9, [x9, _NONVALIDVALUE@GOTPAGEOFF]
Lloh4:
	ldr	x9, [x9]
	cmp	x20, x8
	csel	x0, x20, x9, lo
LBB0_2:
	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
LBB0_3:
	mov	x0, x20
	bl	_ispseudo
	cbz	w0, LBB0_6
; %bb.4:
Lloh5:
	adrp	x8, _LUA_REGISTRYINDEX@GOTPAGE
Lloh6:
	ldr	x8, [x8, _LUA_REGISTRYINDEX@GOTPAGEOFF]
Lloh7:
	ldr	w8, [x8]
	subs	w20, w8, w20
	b.ne	LBB0_8
; %bb.5:
	mov	x0, x19
	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
	b	_G
LBB0_6:
	cbz	w20, LBB0_11
; %bb.7:
	neg	w8, w20
	ldr	x9, [x19]
	ldr	x10, [x21]
	sub	x9, x9, x10
	sub	x9, x9, #4
	cmp	x8, x9, asr #2
	cset	w1, le
	b	LBB0_12
LBB0_8:
Lloh8:
	adrp	x8, _MAXUPVAL@GOTPAGE
Lloh9:
	ldr	x8, [x8, _MAXUPVAL@GOTPAGEOFF]
Lloh10:
	ldr	w8, [x8]
	add	w8, w8, #1
	cmp	w20, w8
	cset	w1, le
Lloh11:
	adrp	x2, l_.str.2@PAGE
Lloh12:
	add	x2, x2, l_.str.2@PAGEOFF
	mov	x0, x19
	bl	_api_check
	ldr	x0, [x21]
	bl	_ttislcf
	cbnz	x0, LBB0_10
; %bb.9:
	ldr	x0, [x21]
	bl	_clCvalue
	ldr	w8, [x0]
	cmp	w20, w8
	b.le	LBB0_13
LBB0_10:
Lloh13:
	adrp	x8, _NONVALIDVALUE@GOTPAGE
Lloh14:
	ldr	x8, [x8, _NONVALIDVALUE@GOTPAGEOFF]
Lloh15:
	ldr	x0, [x8]
	b	LBB0_2
LBB0_11:
	mov	w1, #0
LBB0_12:
Lloh16:
	adrp	x2, l_.str.1@PAGE
Lloh17:
	add	x2, x2, l_.str.1@PAGEOFF
	mov	x0, x19
	bl	_api_check
	ldr	x8, [x19]
	add	x0, x8, w20, sxtw #2
	b	LBB0_2
LBB0_13:
	ldr	x8, [x0, #8]
	sub	w9, w20, #1
	add	x0, x8, w9, sxtw #2
	b	LBB0_2
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpAdd	Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpAdd	Lloh16, Lloh17
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"unacceptable index"

	.comm	_NONVALIDVALUE,8,3              ; @NONVALIDVALUE
l_.str.1:                               ; @.str.1
	.asciz	"invalid index"

	.comm	_LUA_REGISTRYINDEX,4,2          ; @LUA_REGISTRYINDEX
	.comm	_MAXUPVAL,4,2                   ; @MAXUPVAL
l_.str.2:                               ; @.str.2
	.asciz	"upvalue index too large"

	.no_dead_strip	_index2addr
.subsections_via_symbols
