// File: /workspace/github_cpp_makefile_star2_O1/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 0xd7ee(%rip), %r14      # 0x1bfc8
leaq 0x6912(%rip), %rsi      # 0x150f3
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 0x6af2(%rip), %rsi      # 0x152fa
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 0x68b0(%rip), %rsi      # 0x1510a
leaq -0x98(%rbp), %r15
movq %r15, %rdi
movq %r14, %rdx
callq 0xd239
leaq 0x68bc(%rip), %rsi      # 0x1512f
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 0xe89f
movq %rdx, -0x78(%rbp)
movq (%rcx), %rdx
movq %rdx, -0x68(%rbp)
jmp 0xe8a6
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 0xe91e
movl $0x4, %esi
movabsq $0x346dc5d63886594b, %rdi # imm = 0x346DC5D63886594B
movq %rbx, %rcx
cmpq $0x63, %rcx
jbe 0xe917
cmpq $0x3e7, %rcx            # imm = 0x3E7
jbe 0xe91c
cmpq $0x2710, %rcx           # imm = 0x2710
jb 0xe91e
movq %rcx, %rax
mulq %rdi
shrq $0xb, %rdx
addl $0x4, %esi
cmpq $0x1869f, %rcx          # imm = 0x1869F
movq %rdx, %rcx
ja 0xe8e1
addl $-0x3, %esi
jmp 0xe91e
addl $-0x2, %esi
jmp 0xe91e
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 0x10326
movq -0x78(%rbp), %rcx
movq -0x70(%rbp), %r8
movq -0x50(%rbp), %rdx
leaq (%rdx,%r8), %rax
movl $0xf, %esi
cmpq %r14, %rcx
je 0xe960
movq -0x68(%rbp), %rsi
cmpq %rsi, %rax
jbe 0xe979
movl $0xf, %esi
cmpq %r15, -0x58(%rbp)
je 0xe974
movq -0x48(%rbp), %rsi
cmpq %rsi, %rax
jbe 0xe988
movq -0x58(%rbp), %rsi
leaq -0x78(%rbp), %rdi
callq 0x5160
jmp 0xe995
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 0xe9b6
movq %rsi, -0x38(%rbp)
movq (%rcx), %rdx
movq %rdx, -0x28(%rbp)
jmp 0xe9bc
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 0xe9e6
callq 0x5460
movq -0x78(%rbp), %rdi
cmpq %r14, %rdi
je 0xe9f4
callq 0x5460
leaq -0x88(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0xea09
callq 0x5460
movq 0xd5b8(%rip), %rdi      # 0x1bfc8
leaq 0x6726(%rip), %rsi      # 0x1513d
movl $0x22, %edx
callq 0x54f0
movq -0x38(%rbp), %rsi
movq -0x30(%rbp), %rdx
movq 0xd598(%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 0xea7c
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 0xeaae
callq 0x5460
jmp 0xeaae
movq %rax, %rbx
movq -0x78(%rbp), %rdi
cmpq %r14, %rdi
je 0xeac1
callq 0x5460
jmp 0xeac1
movq %rax, %rbx
leaq -0x88(%rbp), %rax
jmp 0xead1
movq %rax, %rbx
leaq -0x28(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0xeadf
callq 0x5460
movq %rbx, %rdi
callq 0x57c0
nop