	.file	"extr_lj_snap.c_lj_snap_restore.c"
	.intel_syntax noprefix
	.text
	.p2align 4
	.globl	lj_snap_restore
	.type	lj_snap_restore, @function
lj_snap_restore:
.LFB0:
	.cfi_startproc
	endbr64
	push	r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	push	r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	push	r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	push	r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	push	rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	mov	rbp, rdi
	push	rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	sub	rsp, 136
	.cfi_def_cfa_offset 192
	mov	r15, QWORD PTR [rdi]
	mov	QWORD PTR 32[rsp], rsi
	mov	esi, DWORD PTR 16[rdi]
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR 120[rsp], rax
	xor	eax, eax
	mov	QWORD PTR 24[rsp], r15
	call	traceref@PLT
	lea	rdx, [r15+r15*2]
	mov	rbx, rax
	mov	rax, QWORD PTR 16[rax]
	mov	r12, QWORD PTR [rbx]
	mov	rdi, rbx
	lea	r14, [rax+rdx*8]
	mov	rax, QWORD PTR 8[r14]
	mov	r13, QWORD PTR [r14]
	mov	rsi, r14
	mov	QWORD PTR 80[rsp], r14
	lea	rax, [r12+rax*4]
	mov	QWORD PTR 8[rsp], r13
	mov	QWORD PTR 40[rsp], rax
	call	snap_nextofs@PLT
	mov	rsi, r15
	mov	rdi, rbx
	cdqe
	lea	rcx, -4[r12+rax*4]
	mov	QWORD PTR 64[rsp], rcx
	call	snap_renamefilter@PLT
	mov	DWORD PTR 96[rsp], eax
	mov	rax, QWORD PTR 40[rsp]
	lea	rax, [rax+r13*4]
	mov	edi, DWORD PTR [rax]
	mov	QWORD PTR 88[rsp], rax
	call	snap_pc@PLT
	mov	r13, QWORD PTR 8[rbp]
	mov	r15, rax
	mov	QWORD PTR 48[rsp], rax
	mov	edi, DWORD PTR 20[r13]
	call	cframe_raw@PLT
	lea	rsi, 4[r15]
	mov	edi, eax
	call	setcframe_pc@PLT
	mov	edi, DWORD PTR 16[r13]
	movsx	r12, DWORD PTR 16[r14]
	add	r12, QWORD PTR 0[r13]
	call	tvref@PLT
	xor	edi, edi
	cmp	r12, rax
	setge	dil
	call	LJ_UNLIKELY@PLT
	test	rax, rax
	jne	.L39
.L2:
	mov	rax, QWORD PTR 0[r13]
	sub	rax, 1
	mov	rdi, rax
	mov	QWORD PTR 16[rsp], rax
	call	frame_ftsz@PLT
	cmp	QWORD PTR 8[rsp], 0
	mov	DWORD PTR 100[rsp], eax
	je	.L3
	xor	r14d, r14d
	mov	r12, QWORD PTR 40[rsp]
	mov	QWORD PTR 72[rsp], r13
	mov	QWORD PTR 40[rsp], rbp
	mov	r15, r14
	jmp	.L11
	.p2align 4,,10
	.p2align 3
.L4:
	add	r15, 1
	cmp	QWORD PTR 8[rsp], r15
	je	.L40
.L11:
	mov	ebp, DWORD PTR [r12+r15*4]
	test	DWORD PTR SNAP_NORESTORE[rip], ebp
	jne	.L4
	mov	edi, ebp
	call	snap_slot@PLT
	mov	rcx, QWORD PTR 16[rsp]
	mov	edi, ebp
	lea	r13, [rcx+rax*8]
	call	snap_ref@PLT
	mov	rdx, QWORD PTR RID_SUNK[rip]
	mov	r14, rax
	mov	rax, QWORD PTR 8[rbx]
	lea	rax, [rax+r14*8]
	mov	QWORD PTR 56[rsp], rax
	cmp	QWORD PTR [rax], rdx
	je	.L41
	sub	rsp, 8
	.cfi_def_cfa_offset 200
	mov	rsi, rbx
	mov	r9, r14
	push	r13
	.cfi_def_cfa_offset 208
	mov	r8d, DWORD PTR 112[rsp]
	mov	rcx, QWORD PTR 40[rsp]
	mov	rdx, QWORD PTR 48[rsp]
	mov	rdi, QWORD PTR 56[rsp]
	call	snap_restoreval@PLT
	cmp	QWORD PTR LJ_SOFTFP[rip], 0
	pop	rsi
	.cfi_def_cfa_offset 200
	pop	rdi
	.cfi_def_cfa_offset 192
	je	.L9
	test	DWORD PTR SNAP_SOFTFPNUM[rip], ebp
	jne	.L42
.L9:
	mov	eax, DWORD PTR SNAP_CONT[rip]
	or	eax, DWORD PTR SNAP_FRAME[rip]
	test	eax, ebp
	je	.L4
	mov	eax, DWORD PTR LJ_FR2[rip]
	xor	edi, edi
	test	eax, eax
	sete	dil
	call	lua_assert@PLT
	mov	edi, ebp
	call	snap_slot@PLT
	mov	esi, DWORD PTR 100[rsp]
	test	rax, rax
	je	.L10
	mov	rax, QWORD PTR 64[rsp]
	mov	esi, DWORD PTR [rax]
	sub	rax, 4
	mov	QWORD PTR 64[rsp], rax
.L10:
	mov	rdi, r13
	add	r13, 8
	add	r15, 1
	call	setframe_ftsz@PLT
	mov	rax, QWORD PTR 72[rsp]
	mov	QWORD PTR [rax], r13
	cmp	QWORD PTR 8[rsp], r15
	jne	.L11
	.p2align 4,,10
	.p2align 3
.L40:
	mov	r13, QWORD PTR 72[rsp]
.L3:
	mov	rcx, QWORD PTR 64[rsp]
	xor	edi, edi
	cmp	QWORD PTR 88[rsp], rcx
	sete	dil
	call	lua_assert@PLT
	mov	rax, QWORD PTR 48[rsp]
	mov	edi, DWORD PTR [rax]
	call	bc_op@PLT
	add	eax, -128
	cmp	eax, 3
	ja	.L43
.L12:
	mov	rax, QWORD PTR 80[rsp]
	mov	rdx, QWORD PTR 16[rsp]
	movsx	rax, DWORD PTR 20[rax]
	lea	rax, [rdx+rax*8]
	mov	QWORD PTR 8[r13], rax
.L1:
	mov	rax, QWORD PTR 120[rsp]
	xor	rax, QWORD PTR fs:40
	jne	.L44
	mov	rax, QWORD PTR 48[rsp]
	add	rsp, 136
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	pop	rbx
	.cfi_def_cfa_offset 48
	pop	rbp
	.cfi_def_cfa_offset 40
	pop	r12
	.cfi_def_cfa_offset 32
	pop	r13
	.cfi_def_cfa_offset 24
	pop	r14
	.cfi_def_cfa_offset 16
	pop	r15
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L41:
	.cfi_restore_state
	test	r15, r15
	je	.L6
	lea	rax, [r12+r15*4]
	mov	QWORD PTR 104[rsp], rbx
	mov	rbx, r12
	mov	rbp, rax
	jmp	.L8
	.p2align 4,,10
	.p2align 3
.L7:
	add	rbx, 4
	cmp	rbp, rbx
	je	.L45
.L8:
	mov	edi, DWORD PTR [rbx]
	call	snap_ref@PLT
	cmp	rax, r14
	jne	.L7
	mov	rbp, rbx
	mov	rbx, QWORD PTR 104[rsp]
	mov	edi, DWORD PTR 0[rbp]
	call	snap_slot@PLT
	mov	rcx, QWORD PTR 16[rsp]
	mov	rdi, QWORD PTR 72[rsp]
	mov	rsi, r13
	lea	rdx, [rcx+rax*8]
	call	copyTV@PLT
	jmp	.L4
	.p2align 4,,10
	.p2align 3
.L42:
	mov	rdi, r13
	call	tvisint@PLT
	test	rax, rax
	je	.L9
	sub	rsp, 8
	.cfi_def_cfa_offset 200
	lea	r9, 1[r14]
	mov	rsi, rbx
	lea	rax, 120[rsp]
	push	rax
	.cfi_def_cfa_offset 208
	mov	r8d, DWORD PTR 112[rsp]
	mov	rcx, QWORD PTR 40[rsp]
	mov	rdx, QWORD PTR 48[rsp]
	mov	rdi, QWORD PTR 56[rsp]
	call	snap_restoreval@PLT
	mov	eax, DWORD PTR 128[rsp]
	mov	DWORD PTR 4[r13], eax
	pop	rdx
	.cfi_def_cfa_offset 200
	pop	rcx
	.cfi_def_cfa_offset 192
	jmp	.L4
	.p2align 4,,10
	.p2align 3
.L39:
	mov	rdi, r13
	call	curr_topL@PLT
	mov	rdi, r13
	mov	QWORD PTR 8[r13], rax
	mov	rax, QWORD PTR 80[rsp]
	mov	r12d, DWORD PTR 16[rax]
	call	curr_proto@PLT
	mov	rdi, r13
	mov	esi, r12d
	sub	esi, DWORD PTR [rax]
	call	lj_state_growstack@PLT
	jmp	.L2
	.p2align 4,,10
	.p2align 3
.L43:
	mov	rax, QWORD PTR 48[rsp]
	mov	edi, DWORD PTR [rax]
	call	bc_op@PLT
	cmp	eax, DWORD PTR BC_FUNCF[rip]
	jge	.L12
	mov	rdi, r13
	call	curr_topL@PLT
	mov	QWORD PTR 8[r13], rax
	jmp	.L1
	.p2align 4,,10
	.p2align 3
.L45:
	mov	rbx, QWORD PTR 104[rsp]
.L6:
	sub	rsp, 8
	.cfi_def_cfa_offset 200
	mov	rsi, rbx
	push	r13
	.cfi_def_cfa_offset 208
	mov	r9, QWORD PTR 72[rsp]
	mov	r8d, DWORD PTR 112[rsp]
	mov	rcx, QWORD PTR 40[rsp]
	mov	rdx, QWORD PTR 48[rsp]
	mov	rdi, QWORD PTR 56[rsp]
	call	snap_unsink@PLT
	pop	r8
	.cfi_def_cfa_offset 200
	pop	r9
	.cfi_def_cfa_offset 192
	jmp	.L4
.L44:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE0:
	.size	lj_snap_restore, .-lj_snap_restore
	.comm	SNAP_SOFTFPNUM,4,4
	.comm	SNAP_NORESTORE,4,4
	.comm	SNAP_FRAME,4,4
	.comm	SNAP_CONT,4,4
	.comm	RID_SUNK,8,8
	.comm	LJ_SOFTFP,8,8
	.comm	LJ_FR2,4,4
	.comm	BC_FUNCF,4,4
	.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_lj_snap.c_lj_snap_restore.c"
	.text
	.section	.rodata.cst4,"aM",%progbits,4
	.align	2
.LC0:
	.word	__stack_chk_guard
	.text
	.align	2
	.global	lj_snap_restore
	.syntax unified
	.arm
	.fpu softvfp
	.type	lj_snap_restore, %function
lj_snap_restore:
	@ args = 0, pretend = 0, frame = 72
	@ frame_needed = 0, uses_anonymous_args = 0
	mov	r3, r1
	push	{r4, r5, r6, r7, r8, r9, r10, fp, lr}
	sub	sp, sp, #92
	ldr	r6, [r0]
	str	r3, [sp, #36]
	ldr	r3, .L47
	ldr	r1, [r0, #8]
	str	r0, [sp, #32]
	ldr	r3, [r3]
	str	r3, [sp, #84]
	mov	r3,#0
	mov	r5, r0
	str	r6, [sp, #24]
	bl	traceref
	ldr	r3, [r0, #8]
	ldr	r4, [r0]
	add	r7, r3, r6, lsl #4
	ldr	r2, [r7, #4]
	mov	r1, r7
	add	r10, r4, r2, lsl #2
	ldr	r8, [r3, r6, lsl #4]
	mov	r9, r0
	str	r7, [sp, #52]
	bl	snap_nextofs
	sub	r3, r0, #-1073741823
	mov	r1, r6
	add	r3, r4, r3, lsl #2
	mov	r0, r9
	str	r3, [sp, #48]
	bl	snap_renamefilter
	mov	r3, r0
	ldr	r0, [r10, r8, lsl #2]
	str	r3, [sp, #28]
	bl	snap_pc
	mov	r6, r0
	ldr	r4, [r5, #4]
	add	r3, r10, r8, lsl #2
	str	r0, [sp, #40]
	ldr	r0, [r4, #12]
	str	r3, [sp, #56]
	str	r4, [sp, #20]
	bl	cframe_raw
	add	r1, r6, #4
	bl	setcframe_pc
	mov	r2, r4
	ldr	r3, [r7, #8]
	ldr	r4, [r4]
	ldr	r0, [r2, #8]
	add	r4, r4, r3
	bl	tvref
	cmp	r4, r0
	movlt	r0, #0
	movge	r0, #1
	bl	LJ_UNLIKELY
	cmp	r0, #0
	bne	.L41
.L2:
	ldr	r3, [sp, #20]
	ldr	r3, [r3]
	sub	r3, r3, #1
	mov	r0, r3
	str	r3, [sp, #16]
	bl	frame_ftsz
	cmp	r8, #0
	str	r0, [sp, #60]
	beq	.L3
	mov	r4, #0
	ldr	fp, .L47+4
	b	.L11
.L4:
	add	r4, r4, #1
	cmp	r8, r4
	beq	.L3
.L11:
	ldr	r5, [r10, r4, lsl #2]
	ldr	r3, [fp]
	tst	r5, r3
	bne	.L4
	mov	r0, r5
	bl	snap_slot
	mov	r7, r0
	ldr	r3, [sp, #16]
	mov	r0, r5
	add	r7, r3, r7, lsl #3
	bl	snap_ref
	ldr	r3, [r9, #4]
	ldr	r2, .L47+8
	mov	r6, r0
	ldr	r1, [r2]
	ldr	r2, [r3, r0, lsl #2]
	add	r3, r3, r0, lsl #2
	cmp	r2, r1
	str	r3, [sp, #44]
	beq	.L42
	ldr	r3, [sp, #28]
	mov	r1, r9
	str	r3, [sp]
	stmib	sp, {r6, r7}
	ldr	r3, [sp, #24]
	ldr	r2, [sp, #36]
	ldr	r0, [sp, #32]
	bl	snap_restoreval
	ldr	r3, .L47+12
	ldr	r3, [r3]
	cmp	r3, #0
	beq	.L9
	ldr	r3, .L47+16
	ldr	r3, [r3]
	tst	r5, r3
	bne	.L43
.L9:
	ldr	r3, .L47+20
	ldr	r2, .L47+24
	ldr	r3, [r3]
	ldr	r2, [r2]
	orr	r3, r3, r2
	tst	r3, r5
	beq	.L4
	ldr	r3, .L47+28
	add	r4, r4, #1
	ldr	r0, [r3]
	clz	r0, r0
	lsr	r0, r0, #5
	bl	lua_assert
	mov	r0, r5
	bl	snap_slot
	cmp	r0, #0
	ldrne	r3, [sp, #48]
	mov	r0, r7
	ldrne	r1, [r3], #-4
	ldreq	r1, [sp, #60]
	strne	r3, [sp, #48]
	bl	setframe_ftsz
	ldr	r3, [sp, #20]
	add	r7, r7, #8
	cmp	r8, r4
	str	r7, [r3]
	bne	.L11
.L3:
	ldr	r3, [sp, #56]
	ldr	r2, [sp, #48]
	sub	r0, r3, r2
	clz	r0, r0
	lsr	r0, r0, #5
	bl	lua_assert
	ldr	r3, [sp, #40]
	ldr	r0, [r3]
	bl	bc_op
	sub	r0, r0, #128
	cmp	r0, #3
	bhi	.L44
.L12:
	ldr	r3, [sp, #52]
	ldr	r2, [sp, #16]
	ldr	r3, [r3, #12]
	add	r3, r2, r3, lsl #3
	ldr	r2, [sp, #20]
	str	r3, [r2, #4]
.L1:
	ldr	r3, .L47
	ldr	r2, [r3]
	ldr	r3, [sp, #84]
	eors	r2, r3, r2
	mov	r3, #0
	bne	.L45
	ldr	r0, [sp, #40]
	add	sp, sp, #92
	@ sp needed
	pop	{r4, r5, r6, r7, r8, r9, r10, fp, pc}
.L42:
	cmp	r4, #0
	beq	.L6
	add	r5, r10, r4, lsl #2
	str	r4, [sp, #68]
	str	r7, [sp, #64]
	mov	r4, r10
	b	.L8
.L7:
	cmp	r5, r4
	beq	.L46
.L8:
	ldr	r0, [r4]
	bl	snap_ref
	cmp	r0, r6
	mov	r7, r4
	add	r4, r4, #4
	bne	.L7
	mov	r5, r7
	ldr	r0, [r5]
	ldr	r7, [sp, #64]
	ldr	r4, [sp, #68]
	bl	snap_slot
	ldr	r3, [sp, #16]
	mov	r1, r7
	add	r2, r3, r0, lsl #3
	ldr	r0, [sp, #20]
	bl	copyTV
	b	.L4
.L43:
	mov	r0, r7
	bl	tvisint
	cmp	r0, #0
	beq	.L9
	ldr	r2, [sp, #28]
	add	r3, sp, #76
	add	r6, r6, #1
	str	r2, [sp]
	str	r3, [sp, #8]
	mov	r1, r9
	ldr	r3, [sp, #24]
	ldr	r2, [sp, #36]
	ldr	r0, [sp, #32]
	str	r6, [sp, #4]
	bl	snap_restoreval
	ldr	r3, [sp, #76]
	str	r3, [r7, #4]
	b	.L4
.L44:
	ldr	r3, [sp, #40]
	ldr	r0, [r3]
	bl	bc_op
	ldr	r3, .L47+32
	ldr	r3, [r3]
	cmp	r0, r3
	bge	.L12
	ldr	r4, [sp, #20]
	mov	r0, r4
	bl	curr_topL
	str	r0, [r4, #4]
	b	.L1
.L41:
	ldr	r5, [sp, #20]
	mov	r0, r5
	bl	curr_topL
	mov	r3, r0
	str	r3, [r5, #4]
	ldr	r3, [sp, #52]
	mov	r0, r5
	ldr	r4, [r3, #8]
	bl	curr_proto
	ldr	r1, [r0]
	mov	r0, r5
	sub	r1, r4, r1
	bl	lj_state_growstack
	b	.L2
.L46:
	ldr	r7, [sp, #64]
	ldr	r4, [sp, #68]
.L6:
	ldr	r3, [sp, #44]
	mov	r1, r9
	str	r3, [sp, #4]
	ldr	r3, [sp, #28]
	ldr	r2, [sp, #36]
	str	r3, [sp]
	ldr	r0, [sp, #32]
	ldr	r3, [sp, #24]
	str	r7, [sp, #8]
	bl	snap_unsink
	b	.L4
.L45:
	bl	__stack_chk_fail
.L48:
	.align	2
.L47:
	.word	.LC0
	.word	SNAP_NORESTORE
	.word	RID_SUNK
	.word	LJ_SOFTFP
	.word	SNAP_SOFTFPNUM
	.word	SNAP_CONT
	.word	SNAP_FRAME
	.word	LJ_FR2
	.word	BC_FUNCF
	.size	lj_snap_restore, .-lj_snap_restore
	.comm	SNAP_SOFTFPNUM,4,4
	.comm	SNAP_NORESTORE,4,4
	.comm	SNAP_FRAME,4,4
	.comm	SNAP_CONT,4,4
	.comm	RID_SUNK,4,4
	.comm	LJ_SOFTFP,4,4
	.comm	LJ_FR2,4,4
	.comm	BC_FUNCF,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
