// File: /workspace/github_cpp_makefile_star2_O3/williewillus[P]panda_scratchpad/src/utils/Tester.cpp
// Function: Tester::restore_snapshot()
int Tester::restore_snapshot() {
	cout << "Restoring snapshot of " << record_device_path 
		<< " to " << replay_device_path << endl;
	string command = "dd if=" MNT_POINT_SNAPSHOT "/" SNAPSHOT_NAME 
		" of=" + replay_device_path + " bs=1M count=" + to_string(device_size);
	cout << "Restore snapshot dev command is : " << command << endl;
	if (system(command.c_str()) != 0 ) {
		return RESTORE_ERR;
	}
	return SUCCESS;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x88, %rsp
movq %rdi, %rbx
movq 0xd844(%rip), %r14      # 0x1bfc8
leaq 0x6958(%rip), %rsi      # 0x150e3
movl $0x16, %edx
movq %r14, %rdi
callq 0x54f0
movq 0x50(%rbx), %rsi
movq 0x58(%rbx), %rdx
movq %r14, %rdi
callq 0x54f0
movq %rax, %r15
leaq 0x6b38(%rip), %rsi      # 0x152ea
movl $0x4, %edx
movq %rax, %rdi
callq 0x54f0
leaq 0x70(%rbx), %r14
movq 0x70(%rbx), %rsi
movq 0x78(%rbx), %rdx
movq %r15, %rdi
callq 0x54f0
movq %rax, %r15
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r15, %rdi
movl $0xa, %esi
callq 0x5470
movsbl %al, %esi
movq %r15, %rdi
callq 0x5040
movq %rax, %rdi
callq 0x5300
leaq 0x68f6(%rip), %rsi      # 0x150fa
leaq -0x98(%rbp), %r15
movq %r15, %rdi
movq %r14, %rdx
callq 0xd1df
leaq 0x6902(%rip), %rsi      # 0x1511f
movq %r15, %rdi
callq 0x5860
leaq -0x68(%rbp), %r14
movq %r14, -0x10(%r14)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0xe849
movq %rdx, -0x78(%rbp)
movq (%rcx), %rdx
movq %rdx, -0x68(%rbp)
jmp 0xe850
movups (%rcx), %xmm0
movups %xmm0, (%r14)
movq 0x8(%rax), %rdx
movq %rdx, -0x70(%rbp)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
movq 0x90(%rbx), %rbx
movl $0x1, %esi
cmpq $0xa, %rbx
jb 0xe8c8
movl $0x4, %esi
movabsq $0x346dc5d63886594b, %rdi # imm = 0x346DC5D63886594B
movq %rbx, %rcx
cmpq $0x63, %rcx
jbe 0xe8c1
cmpq $0x3e7, %rcx            # imm = 0x3E7
jbe 0xe8c6
cmpq $0x2710, %rcx           # imm = 0x2710
jb 0xe8c8
movq %rcx, %rax
mulq %rdi
shrq $0xb, %rdx
addl $0x4, %esi
cmpq $0x1869f, %rcx          # imm = 0x1869F
movq %rdx, %rcx
ja 0xe88b
addl $-0x3, %esi
jmp 0xe8c8
addl $-0x2, %esi
jmp 0xe8c8
decl %esi
movl %esi, %esi
leaq -0x48(%rbp), %r15
movq %r15, -0x10(%r15)
leaq -0x58(%rbp), %rdi
xorl %edx, %edx
callq 0x5510
movq -0x58(%rbp), %rdi
movl -0x50(%rbp), %esi
movq %rbx, %rdx
callq 0x1025a
movq -0x78(%rbp), %rcx
movq -0x70(%rbp), %r8
movq -0x50(%rbp), %rdx
leaq (%rdx,%r8), %rax
movl $0xf, %edi
cmpq %r14, %rcx
je 0xe90a
movq -0x68(%rbp), %rdi
movq -0x58(%rbp), %rsi
cmpq %rdi, %rax
jbe 0xe926
movl $0xf, %edi
cmpq %r15, %rsi
je 0xe921
movq -0x48(%rbp), %rdi
cmpq %rdi, %rax
jbe 0xe931
leaq -0x78(%rbp), %rdi
callq 0x5160
jmp 0xe93e
leaq -0x58(%rbp), %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x54e0
leaq -0x28(%rbp), %rdx
movq %rdx, -0x10(%rdx)
movq (%rax), %rsi
leaq 0x10(%rax), %rcx
cmpq %rcx, %rsi
je 0xe95f
movq %rsi, -0x38(%rbp)
movq (%rcx), %rdx
movq %rdx, -0x28(%rbp)
jmp 0xe965
movups (%rcx), %xmm0
movups %xmm0, (%rdx)
movq %rax, %rdx
addq $0x8, %rdx
movq 0x8(%rax), %rsi
movq %rsi, -0x30(%rbp)
movq %rcx, (%rax)
movq $0x0, (%rdx)
movb $0x0, (%rcx)
movq -0x58(%rbp), %rdi
cmpq %r15, %rdi
je 0xe98f
callq 0x5460
movq -0x78(%rbp), %rdi
cmpq %r14, %rdi
je 0xe99d
callq 0x5460
leaq -0x88(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0xe9b2
callq 0x5460
movq 0xd60f(%rip), %rdi      # 0x1bfc8
leaq 0x676d(%rip), %rsi      # 0x1512d
movl $0x22, %edx
callq 0x54f0
movq -0x38(%rbp), %rsi
movq -0x30(%rbp), %rdx
movq 0xd5ef(%rip), %rdi      # 0x1bfc8
callq 0x54f0
movq %rax, %rbx
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x5470
movsbl %al, %esi
movq %rbx, %rdi
callq 0x5040
movq %rax, %rdi
callq 0x5300
movq -0x38(%rbp), %rdi
callq 0x53e0
movl %eax, %ebx
leaq -0x28(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0xea25
callq 0x5460
xorl %eax, %eax
testl %ebx, %ebx
sete %al
leal -0x2(,%rax,2), %eax
addq $0x88, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
movq -0x58(%rbp), %rdi
cmpq %r15, %rdi
je 0xea57
callq 0x5460
jmp 0xea57
movq %rax, %rbx
movq -0x78(%rbp), %rdi
cmpq %r14, %rdi
je 0xea6a
callq 0x5460
jmp 0xea6a
movq %rax, %rbx
leaq -0x88(%rbp), %rax
jmp 0xea7a
movq %rax, %rbx
leaq -0x28(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0xea88
callq 0x5460
movq %rbx, %rdi
callq 0x57c0