	.file	"extr_lutils.c_lua_readfile.c"
	.intel_syntax noprefix
	.text
	.p2align 4
	.type	lua_readfile, @function
lua_readfile:
.LFB0:
	.cfi_startproc
	endbr64
	push	r13
	.cfi_def_cfa_offset 16
	.cfi_offset 13, -16
	push	r12
	.cfi_def_cfa_offset 24
	.cfi_offset 12, -24
	push	rbp
	.cfi_def_cfa_offset 32
	.cfi_offset 6, -32
	mov	rbp, rdi
	push	rbx
	.cfi_def_cfa_offset 40
	.cfi_offset 3, -40
	sub	rsp, 8
	.cfi_def_cfa_offset 48
	call	lua_gettop@PLT
	test	eax, eax
	jle	.L4
	mov	rdi, rbp
	call	lua_gettop@PLT
	cmp	eax, 2
	jle	.L12
.L4:
	mov	rdi, rbp
	call	lua_pushnil@PLT
	mov	rdi, rbp
	xor	esi, esi
	call	lua_pushinteger@PLT
	add	rsp, 8
	.cfi_remember_state
	.cfi_def_cfa_offset 40
	mov	eax, 2
	pop	rbx
	.cfi_def_cfa_offset 32
	pop	rbp
	.cfi_def_cfa_offset 24
	pop	r12
	.cfi_def_cfa_offset 16
	pop	r13
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L12:
	.cfi_restore_state
	mov	esi, 1
	mov	rdi, rbp
	call	lua_touserdata@PLT
	mov	rbx, rax
	test	rax, rax
	je	.L4
	cmp	QWORD PTR [rax], 0
	je	.L4
	mov	rdi, rbp
	call	lua_gettop@PLT
	cmp	eax, 2
	je	.L13
	mov	rax, QWORD PTR [rbx]
	mov	r13, QWORD PTR [rax]
.L6:
	mov	rdi, r13
	call	malloc@PLT
	mov	rcx, QWORD PTR [rbx]
	mov	rdx, r13
	mov	esi, 1
	mov	rdi, rax
	mov	r12, rax
	call	fread@PLT
	mov	rsi, r12
	mov	rdi, rbp
	mov	rdx, rax
	mov	r13, rax
	call	lua_pushlstring@PLT
	mov	rdi, r12
	call	free@PLT
	mov	rsi, r13
	mov	rdi, rbp
	call	lua_pushinteger@PLT
	add	rsp, 8
	.cfi_remember_state
	.cfi_def_cfa_offset 40
	mov	eax, 2
	pop	rbx
	.cfi_def_cfa_offset 32
	pop	rbp
	.cfi_def_cfa_offset 24
	pop	r12
	.cfi_def_cfa_offset 16
	pop	r13
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L13:
	.cfi_restore_state
	mov	esi, 2
	mov	rdi, rbp
	call	lua_tonumber@PLT
	mov	r13, rax
	jmp	.L6
	.cfi_endproc
.LFE0:
	.size	lua_readfile, .-lua_readfile
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	 1f - 0f
	.long	 4f - 1f
	.long	 5
0:
	.string	 "GNU"
1:
	.align 8
	.long	 0xc0000002
	.long	 3f - 2f
2:
	.long	 0x3
3:
	.align 8
4:

	.arch armv5t
	.eabi_attribute 20, 1
	.eabi_attribute 21, 1
	.eabi_attribute 23, 3
	.eabi_attribute 24, 1
	.eabi_attribute 25, 1
	.eabi_attribute 26, 2
	.eabi_attribute 30, 2
	.eabi_attribute 34, 0
	.eabi_attribute 18, 4
	.file	"extr_lutils.c_lua_readfile.c"
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	lua_readfile, %function
lua_readfile:
	@ args = 0, pretend = 0, frame = 0
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, lr}
	mov	r4, r0
	bl	lua_gettop
	cmp	r0, #0
	ble	.L4
	mov	r0, r4
	bl	lua_gettop
	cmp	r0, #2
	ble	.L15
.L4:
	mov	r0, r4
	bl	lua_pushnil
	mov	r0, r4
	mov	r1, #0
	bl	lua_pushinteger
	mov	r0, #2
	pop	{r4, r5, r6, pc}
.L15:
	mov	r1, #1
	mov	r0, r4
	bl	lua_touserdata
	subs	r5, r0, #0
	beq	.L4
	ldr	r3, [r5]
	cmp	r3, #0
	beq	.L4
	mov	r0, r4
	bl	lua_gettop
	cmp	r0, #2
	beq	.L16
	ldr	r3, [r5]
	ldr	r6, [r3]
.L6:
	mov	r0, r6
	bl	malloc
	ldr	r3, [r5]
	mov	r2, r6
	mov	r1, #1
	mov	r6, r0
	bl	fread
	mov	r5, r0
	mov	r2, r0
	mov	r1, r6
	mov	r0, r4
	bl	lua_pushlstring
	mov	r0, r6
	bl	free
	mov	r1, r5
	mov	r0, r4
	bl	lua_pushinteger
	mov	r0, #2
	pop	{r4, r5, r6, pc}
.L16:
	mov	r1, r0
	mov	r0, r4
	bl	lua_tonumber
	mov	r6, r0
	b	.L6
	.size	lua_readfile, .-lua_readfile
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
