	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function pmain
_pmain:                                 ## @pmain
	.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, %r12
	movl	$1, %esi
	callq	_lua_tointeger
	movq	%rax, %r14
	movq	%r12, %rdi
	movl	$2, %esi
	callq	_lua_touserdata
	movq	%rax, %r13
	leaq	-44(%rbp), %rsi
	movq	%rax, %rdi
	callq	_collectargs
	movl	%eax, %r15d
	movq	%r12, %rdi
	callq	_luaL_checkversion
	movq	(%r13), %rax
	testq	%rax, %rax
	je	LBB0_3
## %bb.1:
	cmpb	$0, (%rax)
	je	LBB0_3
## %bb.2:
	movq	_progname@GOTPCREL(%rip), %rcx
	movq	%rax, (%rcx)
LBB0_3:
	movq	_has_error@GOTPCREL(%rip), %rax
	cmpl	(%rax), %r15d
	jne	LBB0_5
## %bb.4:
	movslq	-44(%rbp), %rax
	movq	(%r13,%rax,8), %rdi
	callq	_print_usage
	xorl	%ebx, %ebx
	jmp	LBB0_22
LBB0_5:
	movq	_has_v@GOTPCREL(%rip), %rax
	testl	%r15d, (%rax)
	je	LBB0_7
## %bb.6:
	xorl	%eax, %eax
	callq	_print_version
LBB0_7:
	movq	_has_E@GOTPCREL(%rip), %rbx
	testl	%r15d, (%rbx)
	je	LBB0_9
## %bb.8:
	movq	%r12, %rdi
	movl	$1, %esi
	callq	_lua_pushboolean
	movq	_LUA_REGISTRYINDEX@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	L_.str(%rip), %rdx
	movq	%r12, %rdi
	callq	_lua_setfield
LBB0_9:
	movq	%r12, %rdi
	callq	_luaL_openlibs
	movl	-44(%rbp), %ecx
	movq	%r12, %rdi
	movq	%r13, %rsi
	movl	%r14d, %edx
	callq	_createargtable
	testl	%r15d, (%rbx)
	jne	LBB0_11
## %bb.10:
	movq	%r12, %rdi
	callq	_handle_luainit
	movq	_LUA_OK@GOTPCREL(%rip), %rcx
	xorl	%ebx, %ebx
	cmpq	(%rcx), %rax
	jne	LBB0_22
LBB0_11:
	movl	-44(%rbp), %edx
	movq	%r12, %rdi
	movq	%r13, %rsi
	callq	_runargs
	xorl	%ebx, %ebx
	testl	%eax, %eax
	je	LBB0_22
## %bb.12:
	movslq	-44(%rbp), %rax
	cmpl	%r14d, %eax
	jge	LBB0_14
## %bb.13:
	leaq	(,%rax,8), %rsi
	addq	%r13, %rsi
	movq	%r12, %rdi
	callq	_handle_script
	movq	_LUA_OK@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_22
LBB0_14:
	movq	_has_i@GOTPCREL(%rip), %rax
	testl	%r15d, (%rax)
	je	LBB0_16
LBB0_15:
	movq	%r12, %rdi
	callq	_doREPL
	jmp	LBB0_21
LBB0_16:
	cmpl	%r14d, -44(%rbp)
	jne	LBB0_21
## %bb.17:
	movq	_has_e@GOTPCREL(%rip), %rax
	movq	_has_v@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	orl	(%rax), %ecx
	testl	%r15d, %ecx
	je	LBB0_18
LBB0_21:
	movl	$1, %ebx
	movq	%r12, %rdi
	movl	$1, %esi
	callq	_lua_pushboolean
LBB0_22:
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_18:
	xorl	%eax, %eax
	callq	_lua_stdin_is_tty
	testq	%rax, %rax
	je	LBB0_20
## %bb.19:
	xorl	%eax, %eax
	callq	_print_version
	jmp	LBB0_15
LBB0_20:
	movq	%r12, %rdi
	xorl	%esi, %esi
	callq	_dofile
	jmp	LBB0_21
	.cfi_endproc
                                        ## -- End function
	.comm	_progname,8,3                   ## @progname
	.comm	_has_error,4,2                  ## @has_error
	.comm	_has_v,4,2                      ## @has_v
	.comm	_has_E,4,2                      ## @has_E
	.comm	_LUA_REGISTRYINDEX,4,2          ## @LUA_REGISTRYINDEX
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"LUA_NOENV"

	.comm	_LUA_OK,8,3                     ## @LUA_OK
	.comm	_has_i,4,2                      ## @has_i
	.comm	_has_e,4,2                      ## @has_e
	.no_dead_strip	_pmain
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function pmain
_pmain:                                 ; @pmain
	.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
	mov	w1, #1
	bl	_lua_tointeger
	mov	x20, x0
	mov	x0, x19
	mov	w1, #2
	bl	_lua_touserdata
	mov	x22, x0
	add	x1, sp, #12
	bl	_collectargs
	mov	x21, x0
	mov	x0, x19
	bl	_luaL_checkversion
	ldr	x8, [x22]
	cbz	x8, LBB0_3
; %bb.1:
	ldrb	w9, [x8]
	cbz	w9, LBB0_3
; %bb.2:
Lloh0:
	adrp	x9, _progname@GOTPAGE
Lloh1:
	ldr	x9, [x9, _progname@GOTPAGEOFF]
Lloh2:
	str	x8, [x9]
LBB0_3:
Lloh3:
	adrp	x8, _has_error@GOTPAGE
Lloh4:
	ldr	x8, [x8, _has_error@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
	cmp	w21, w8
	b.ne	LBB0_5
; %bb.4:
	ldrsw	x8, [sp, #12]
	ldr	x0, [x22, x8, lsl #3]
	bl	_print_usage
	b	LBB0_16
LBB0_5:
Lloh6:
	adrp	x23, _has_v@GOTPAGE
Lloh7:
	ldr	x23, [x23, _has_v@GOTPAGEOFF]
	ldr	w8, [x23]
	tst	w8, w21
	b.eq	LBB0_7
; %bb.6:
	bl	_print_version
LBB0_7:
Lloh8:
	adrp	x24, _has_E@GOTPAGE
Lloh9:
	ldr	x24, [x24, _has_E@GOTPAGEOFF]
	ldr	w8, [x24]
	tst	w8, w21
	b.eq	LBB0_9
; %bb.8:
	mov	x0, x19
	mov	w1, #1
	bl	_lua_pushboolean
Lloh10:
	adrp	x8, _LUA_REGISTRYINDEX@GOTPAGE
Lloh11:
	ldr	x8, [x8, _LUA_REGISTRYINDEX@GOTPAGEOFF]
Lloh12:
	ldr	w1, [x8]
Lloh13:
	adrp	x2, l_.str@PAGE
Lloh14:
	add	x2, x2, l_.str@PAGEOFF
	mov	x0, x19
	bl	_lua_setfield
LBB0_9:
	mov	x0, x19
	bl	_luaL_openlibs
	ldr	w3, [sp, #12]
	mov	x0, x19
	mov	x1, x22
	mov	x2, x20
	bl	_createargtable
	ldr	w8, [x24]
	tst	w8, w21
	b.ne	LBB0_11
; %bb.10:
	mov	x0, x19
	bl	_handle_luainit
Lloh15:
	adrp	x8, _LUA_OK@GOTPAGE
Lloh16:
	ldr	x8, [x8, _LUA_OK@GOTPAGEOFF]
Lloh17:
	ldr	x8, [x8]
	cmp	x0, x8
	b.ne	LBB0_16
LBB0_11:
	ldr	w2, [sp, #12]
	mov	x0, x19
	mov	x1, x22
	bl	_runargs
	cbz	w0, LBB0_16
; %bb.12:
	ldrsw	x8, [sp, #12]
	cmp	w8, w20
	b.ge	LBB0_14
; %bb.13:
	add	x1, x22, x8, lsl #3
	mov	x0, x19
	bl	_handle_script
Lloh18:
	adrp	x8, _LUA_OK@GOTPAGE
Lloh19:
	ldr	x8, [x8, _LUA_OK@GOTPAGEOFF]
Lloh20:
	ldr	x8, [x8]
	cmp	x0, x8
	b.ne	LBB0_16
LBB0_14:
Lloh21:
	adrp	x8, _has_i@GOTPAGE
Lloh22:
	ldr	x8, [x8, _has_i@GOTPAGEOFF]
Lloh23:
	ldr	w8, [x8]
	tst	w8, w21
	b.eq	LBB0_18
LBB0_15:
	mov	x0, x19
	bl	_doREPL
	b	LBB0_20
LBB0_16:
	mov	w20, #0
LBB0_17:
	mov	x0, x20
	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
LBB0_18:
	ldr	w8, [sp, #12]
	cmp	w8, w20
	b.ne	LBB0_20
; %bb.19:
Lloh24:
	adrp	x8, _has_e@GOTPAGE
Lloh25:
	ldr	x8, [x8, _has_e@GOTPAGEOFF]
Lloh26:
	ldr	w8, [x8]
	ldr	w9, [x23]
	orr	w8, w9, w8
	tst	w8, w21
	b.eq	LBB0_21
LBB0_20:
	mov	w20, #1
	mov	x0, x19
	mov	w1, #1
	bl	_lua_pushboolean
	b	LBB0_17
LBB0_21:
	bl	_lua_stdin_is_tty
	cbz	x0, LBB0_23
; %bb.22:
	bl	_print_version
	b	LBB0_15
LBB0_23:
	mov	x0, x19
	mov	x1, #0
	bl	_dofile
	b	LBB0_20
	.loh AdrpLdrGotStr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpAdd	Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.loh AdrpLdrGotLdr	Lloh24, Lloh25, Lloh26
	.cfi_endproc
                                        ; -- End function
	.comm	_progname,8,3                   ; @progname
	.comm	_has_error,4,2                  ; @has_error
	.comm	_has_v,4,2                      ; @has_v
	.comm	_has_E,4,2                      ; @has_E
	.comm	_LUA_REGISTRYINDEX,4,2          ; @LUA_REGISTRYINDEX
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"LUA_NOENV"

	.comm	_LUA_OK,8,3                     ; @LUA_OK
	.comm	_has_i,4,2                      ; @has_i
	.comm	_has_e,4,2                      ; @has_e
	.no_dead_strip	_pmain
.subsections_via_symbols
