	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function lua_readfile
_lua_readfile:                          ## @lua_readfile
	.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, %r15
	callq	_lua_gettop
	testl	%eax, %eax
	jle	LBB0_2
## %bb.1:
	movq	%r15, %rdi
	callq	_lua_gettop
	cmpl	$3, %eax
	jge	LBB0_2
## %bb.3:
	movq	%r15, %rdi
	movl	$1, %esi
	callq	_lua_touserdata
	testq	%rax, %rax
	je	LBB0_2
## %bb.4:
	movq	%rax, %r14
	cmpq	$0, (%rax)
	je	LBB0_2
## %bb.5:
	movq	%r15, %rdi
	callq	_lua_gettop
	cmpl	$2, %eax
	jne	LBB0_7
## %bb.6:
	movq	%r15, %rdi
	movl	$2, %esi
	callq	_lua_tonumber
	movq	%rax, %rbx
	jmp	LBB0_8
LBB0_2:
	movq	%r15, %rdi
	callq	_lua_pushnil
	xorl	%ebx, %ebx
LBB0_9:
	movq	%r15, %rdi
	movq	%rbx, %rsi
	callq	_lua_pushinteger
	movl	$2, %eax
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_7:
	movq	(%r14), %rax
	movq	(%rax), %rbx
LBB0_8:
	movq	%rbx, %rdi
	callq	_malloc
	movq	%rax, %r12
	movq	(%r14), %rcx
	movq	%rax, %rdi
	movl	$1, %esi
	movq	%rbx, %rdx
	callq	_fread
	movq	%rax, %rbx
	movq	%r15, %rdi
	movq	%r12, %rsi
	movq	%rax, %rdx
	callq	_lua_pushlstring
	movq	%r12, %rdi
	callq	_free
	jmp	LBB0_9
	.cfi_endproc
                                        ## -- End function
	.no_dead_strip	_lua_readfile
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function lua_readfile
_lua_readfile:                          ; @lua_readfile
	.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
	bl	_lua_gettop
	cmp	w0, #1
	b.lt	LBB0_6
; %bb.1:
	mov	x0, x19
	bl	_lua_gettop
	cmp	w0, #3
	b.ge	LBB0_6
; %bb.2:
	mov	x0, x19
	mov	w1, #1
	bl	_lua_touserdata
	cbz	x0, LBB0_6
; %bb.3:
	mov	x20, x0
	ldr	x8, [x0]
	cbz	x8, LBB0_6
; %bb.4:
	mov	x0, x19
	bl	_lua_gettop
	cmp	w0, #2
	b.ne	LBB0_8
; %bb.5:
	mov	x0, x19
	mov	w1, #2
	bl	_lua_tonumber
	mov	x21, x0
	b	LBB0_9
LBB0_6:
	mov	x0, x19
	bl	_lua_pushnil
	mov	x20, #0
LBB0_7:
	mov	x0, x19
	mov	x1, x20
	bl	_lua_pushinteger
	mov	w0, #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_8:
	ldr	x8, [x20]
	ldr	x21, [x8]
LBB0_9:
	mov	x0, x21
	bl	_malloc
	mov	x22, x0
	ldr	x3, [x20]
	mov	w1, #1
	mov	x2, x21
	bl	_fread
	mov	x20, x0
	mov	x0, x19
	mov	x1, x22
	mov	x2, x20
	bl	_lua_pushlstring
	mov	x0, x22
	bl	_free
	b	LBB0_7
	.cfi_endproc
                                        ; -- End function
	.no_dead_strip	_lua_readfile
.subsections_via_symbols
