	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function os_exit
_os_exit:                               ## @os_exit
	.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
	movq	%rdi, %rbx
	movl	$1, %esi
	callq	_lua_isboolean
	testq	%rax, %rax
	je	LBB0_3
## %bb.1:
	movq	%rbx, %rdi
	movl	$1, %esi
	callq	_lua_toboolean
	testq	%rax, %rax
	jne	LBB0_4
## %bb.2:
	movq	_EXIT_FAILURE@GOTPCREL(%rip), %rax
	jmp	LBB0_5
LBB0_3:
	movq	_EXIT_SUCCESS@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%rbx, %rdi
	movl	$1, %esi
	callq	_luaL_optinteger
	movq	%rax, %r14
	jmp	LBB0_6
LBB0_4:
	movq	_EXIT_SUCCESS@GOTPCREL(%rip), %rax
LBB0_5:
	movl	(%rax), %r14d
LBB0_6:
	movq	%rbx, %rdi
	movl	$2, %esi
	callq	_lua_toboolean
	testq	%rax, %rax
	je	LBB0_8
## %bb.7:
	movq	%rbx, %rdi
	callq	_lua_close
LBB0_8:
	testq	%rbx, %rbx
	jne	LBB0_10
## %bb.9:
	xorl	%eax, %eax
	popq	%rbx
	popq	%r14
	popq	%rbp
	retq
LBB0_10:
	movl	%r14d, %edi
	callq	_exit
	.cfi_endproc
                                        ## -- End function
	.comm	_EXIT_SUCCESS,4,2               ## @EXIT_SUCCESS
	.comm	_EXIT_FAILURE,4,2               ## @EXIT_FAILURE
	.no_dead_strip	_os_exit
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function os_exit
_os_exit:                               ; @os_exit
	.cfi_startproc
; %bb.0:
	stp	x20, x19, [sp, #-32]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 32
	stp	x29, x30, [sp, #16]             ; 16-byte Folded Spill
	add	x29, sp, #16
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
	mov	x19, x0
	mov	w1, #1
	bl	_lua_isboolean
	cbz	x0, LBB0_2
; %bb.1:
	mov	x0, x19
	mov	w1, #1
	bl	_lua_toboolean
Lloh0:
	adrp	x8, _EXIT_SUCCESS@GOTPAGE
Lloh1:
	ldr	x8, [x8, _EXIT_SUCCESS@GOTPAGEOFF]
Lloh2:
	adrp	x9, _EXIT_FAILURE@GOTPAGE
Lloh3:
	ldr	x9, [x9, _EXIT_FAILURE@GOTPAGEOFF]
	cmp	x0, #0
	csel	x8, x9, x8, eq
	ldr	w20, [x8]
	b	LBB0_3
LBB0_2:
Lloh4:
	adrp	x8, _EXIT_SUCCESS@GOTPAGE
Lloh5:
	ldr	x8, [x8, _EXIT_SUCCESS@GOTPAGEOFF]
Lloh6:
	ldr	w2, [x8]
	mov	x0, x19
	mov	w1, #1
	bl	_luaL_optinteger
	mov	x20, x0
LBB0_3:
	mov	x0, x19
	mov	w1, #2
	bl	_lua_toboolean
	cbz	x0, LBB0_5
; %bb.4:
	mov	x0, x19
	bl	_lua_close
LBB0_5:
	cbnz	x19, LBB0_7
; %bb.6:
	mov	w0, #0
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	ret
LBB0_7:
	mov	x0, x20
	bl	_exit
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh4, Lloh5, Lloh6
	.cfi_endproc
                                        ; -- End function
	.comm	_EXIT_SUCCESS,4,2               ; @EXIT_SUCCESS
	.comm	_EXIT_FAILURE,4,2               ; @EXIT_FAILURE
	.no_dead_strip	_os_exit
.subsections_via_symbols
