	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function codepoint
_codepoint:                             ## @codepoint
	.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	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r12
	leaq	-48(%rbp), %rdx
	movl	$1, %esi
	callq	_luaL_checklstring
	movq	%rax, -64(%rbp)                 ## 8-byte Spill
	movq	%r12, %rdi
	movl	$2, %esi
	movl	$1, %edx
	callq	_luaL_optinteger
	movq	-48(%rbp), %rsi
	movl	%eax, %edi
	callq	_u_posrelat
	movl	%eax, %r15d
	movq	%r12, %rdi
	movl	$3, %esi
	movl	%eax, %edx
	callq	_luaL_optinteger
	movq	-48(%rbp), %rsi
	movl	%eax, %edi
	callq	_u_posrelat
	movl	%eax, %r13d
	xorl	%esi, %esi
	testl	%r15d, %r15d
	setg	%sil
	leaq	L_.str(%rip), %rbx
	movq	%r12, %rdi
	movl	$2, %edx
	movq	%rbx, %rcx
	callq	_luaL_argcheck
	xorl	%esi, %esi
	cmpl	-48(%rbp), %r13d
	setle	%sil
	movq	%r12, %rdi
	movl	$3, %edx
	movq	%rbx, %rcx
	callq	_luaL_argcheck
	xorl	%r14d, %r14d
	movl	%r13d, %esi
	subl	%r15d, %esi
	jl	LBB0_8
## %bb.1:
	movq	-64(%rbp), %rbx                 ## 8-byte Reload
	movq	_INT_MAX@GOTPCREL(%rip), %rax
	cmpl	(%rax), %esi
	jge	LBB0_2
## %bb.4:
	incl	%esi
	leaq	L_.str.1(%rip), %rdx
	movq	%r12, %rdi
	callq	_luaL_checkstack
	movslq	%r13d, %r13
	addq	%rbx, %r13
	movslq	%r15d, %rax
	addq	%rax, %rbx
	decq	%rbx
	xorl	%r14d, %r14d
	leaq	-52(%rbp), %r15
	.p2align	4, 0x90
LBB0_5:                                 ## =>This Inner Loop Header: Depth=1
	movq	%rbx, %rdi
	movq	%r15, %rsi
	callq	_utf8_decode
	testq	%rax, %rax
	je	LBB0_6
## %bb.7:                               ##   in Loop: Header=BB0_5 Depth=1
	movq	%rax, %rbx
	movl	-52(%rbp), %esi
	movq	%r12, %rdi
	callq	_lua_pushinteger
	incl	%r14d
	cmpq	%r13, %rbx
	jb	LBB0_5
	jmp	LBB0_8
LBB0_2:
	leaq	L_.str.1(%rip), %rsi
	jmp	LBB0_3
LBB0_6:
	leaq	L_.str.2(%rip), %rsi
LBB0_3:
	movq	%r12, %rdi
	callq	_luaL_error
	movl	%eax, %r14d
LBB0_8:
	movl	%r14d, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"out of range"

	.comm	_INT_MAX,4,2                    ## @INT_MAX
L_.str.1:                               ## @.str.1
	.asciz	"string slice too long"

L_.str.2:                               ## @.str.2
	.asciz	"invalid UTF-8 code"

	.no_dead_strip	_codepoint
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function codepoint
_codepoint:                             ; @codepoint
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #80
	.cfi_def_cfa_offset 80
	stp	x24, x23, [sp, #16]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #32]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #48]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #64]             ; 16-byte Folded Spill
	add	x29, sp, #64
	.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
	mov	x19, x0
	add	x2, sp, #8
	mov	w1, #1
	bl	_luaL_checklstring
	mov	x20, x0
	mov	x0, x19
	mov	w1, #2
	mov	w2, #1
	bl	_luaL_optinteger
	ldr	x1, [sp, #8]
	bl	_u_posrelat
	mov	x21, x0
	mov	x0, x19
	mov	w1, #3
	mov	x2, x21
	bl	_luaL_optinteger
	ldr	x1, [sp, #8]
	bl	_u_posrelat
	mov	x23, x0
	cmp	w21, #0
	cset	w1, gt
Lloh0:
	adrp	x22, l_.str@PAGE
Lloh1:
	add	x22, x22, l_.str@PAGEOFF
	mov	x0, x19
	mov	w2, #2
	mov	x3, x22
	bl	_luaL_argcheck
	ldr	w8, [sp, #8]
	cmp	w23, w8
	cset	w1, le
	mov	x0, x19
	mov	w2, #3
	mov	x3, x22
	bl	_luaL_argcheck
	subs	w8, w23, w21
	b.ge	LBB0_2
; %bb.1:
	mov	w22, #0
	b	LBB0_9
LBB0_2:
Lloh2:
	adrp	x9, _INT_MAX@GOTPAGE
Lloh3:
	ldr	x9, [x9, _INT_MAX@GOTPAGEOFF]
Lloh4:
	ldr	w9, [x9]
	cmp	w8, w9
	b.ge	LBB0_6
; %bb.3:
	add	w1, w8, #1
Lloh5:
	adrp	x2, l_.str.1@PAGE
Lloh6:
	add	x2, x2, l_.str.1@PAGEOFF
	mov	x0, x19
	bl	_luaL_checkstack
	mov	w22, #0
	add	x23, x20, w23, sxtw
	sub	w8, w21, #1
	add	x20, x20, w8, sxtw
LBB0_4:                                 ; =>This Inner Loop Header: Depth=1
	add	x1, sp, #4
	mov	x0, x20
	bl	_utf8_decode
	cbz	x0, LBB0_7
; %bb.5:                                ;   in Loop: Header=BB0_4 Depth=1
	mov	x20, x0
	ldr	w1, [sp, #4]
	mov	x0, x19
	bl	_lua_pushinteger
	add	w22, w22, #1
	cmp	x20, x23
	b.lo	LBB0_4
	b	LBB0_9
LBB0_6:
Lloh7:
	adrp	x1, l_.str.1@PAGE
Lloh8:
	add	x1, x1, l_.str.1@PAGEOFF
	b	LBB0_8
LBB0_7:
Lloh9:
	adrp	x1, l_.str.2@PAGE
Lloh10:
	add	x1, x1, l_.str.2@PAGEOFF
LBB0_8:
	mov	x0, x19
	bl	_luaL_error
	mov	x22, x0
LBB0_9:
	mov	x0, x22
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #80
	ret
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpAdd	Lloh5, Lloh6
	.loh AdrpAdd	Lloh7, Lloh8
	.loh AdrpAdd	Lloh9, Lloh10
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"out of range"

	.comm	_INT_MAX,4,2                    ; @INT_MAX
l_.str.1:                               ; @.str.1
	.asciz	"string slice too long"

l_.str.2:                               ; @.str.2
	.asciz	"invalid UTF-8 code"

	.no_dead_strip	_codepoint
.subsections_via_symbols
