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

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x180, %rsp            # imm = 0x180
movq %rdi, -0x10(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x160(%rbp)
movq 0x1b51f(%rip), %rdi     # 0x34fc0
leaq 0xb7a1(%rip), %rsi      # 0x25249
callq 0x6520
movq -0x160(%rbp), %rsi
movq %rax, %rdi
addq $0x50, %rsi
movq %rsi, -0x158(%rbp)
callq 0x64a0
movq %rax, %rdi
movq 0x1b4c7(%rip), %rsi     # 0x34f98
callq 0x6580
movq -0x158(%rbp), %rdx
leaq 0xb77b(%rip), %rsi      # 0x2525f
leaq -0x110(%rbp), %rdi
movq %rdi, -0x150(%rbp)
callq 0x18c40
movq -0x150(%rbp), %rsi
leaq 0xb7d6(%rip), %rdx      # 0x252db
leaq -0xf0(%rbp), %rdi
callq 0x9d60
jmp 0x19b13
leaq 0xb74c(%rip), %rdx      # 0x25266
leaq -0xd0(%rbp), %rdi
leaq -0xf0(%rbp), %rsi
callq 0x9d60
jmp 0x19b2f
leaq 0xbcd4(%rip), %rdx      # 0x2580a
leaq -0xb0(%rbp), %rdi
leaq -0xd0(%rbp), %rsi
callq 0x9d60
jmp 0x19b4b
leaq 0xb721(%rip), %rdx      # 0x25273
leaq -0x90(%rbp), %rdi
leaq -0xb0(%rbp), %rsi
callq 0x9d60
jmp 0x19b67
leaq 0xb713(%rip), %rdx      # 0x25281
leaq -0x70(%rbp), %rdi
leaq -0x90(%rbp), %rsi
callq 0x9d60
jmp 0x19b80
leaq 0xb760(%rip), %rdx      # 0x252e7
leaq -0x50(%rbp), %rdi
leaq -0x70(%rbp), %rsi
callq 0x9d60
jmp 0x19b96
movq -0x160(%rbp), %rax
movq 0x90(%rax), %rsi
leaq -0x140(%rbp), %rdi
callq 0x1c410
jmp 0x19bb2
leaq -0x30(%rbp), %rdi
leaq -0x50(%rbp), %rsi
leaq -0x140(%rbp), %rdx
callq 0x1c340
jmp 0x19bc8
leaq -0x140(%rbp), %rdi
callq 0x69d8
leaq -0x50(%rbp), %rdi
callq 0x69d8
leaq -0x70(%rbp), %rdi
callq 0x69d8
leaq -0x90(%rbp), %rdi
callq 0x69d8
leaq -0xb0(%rbp), %rdi
callq 0x69d8
leaq -0xd0(%rbp), %rdi
callq 0x69d8
leaq -0xf0(%rbp), %rdi
callq 0x69d8
leaq -0x110(%rbp), %rdi
callq 0x69d8
movq 0x1b397(%rip), %rdi     # 0x34fc0
leaq 0xb659(%rip), %rsi      # 0x25289
callq 0x6520
movq %rax, -0x168(%rbp)
jmp 0x19c3e
movq -0x168(%rbp), %rdi
leaq -0x30(%rbp), %rsi
callq 0x64a0
movq %rax, -0x170(%rbp)
jmp 0x19c57
movq -0x170(%rbp), %rdi
movq 0x1b333(%rip), %rsi     # 0x34f98
callq 0x6580
jmp 0x19c6c
leaq -0x30(%rbp), %rdi
callq 0x6220
movq %rax, %rdi
callq 0x6470
movl %eax, -0x174(%rbp)
jmp 0x19c85
movl -0x174(%rbp), %eax
cmpl $0x0, %eax
je 0x19dca
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
movl $0x1, -0x144(%rbp)
jmp 0x19ddb
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x118(%rbp)
movl %eax, -0x11c(%rbp)
jmp 0x19d9f
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x118(%rbp)
movl %eax, -0x11c(%rbp)
jmp 0x19d93
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x118(%rbp)
movl %eax, -0x11c(%rbp)
jmp 0x19d87
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x118(%rbp)
movl %eax, -0x11c(%rbp)
jmp 0x19d7b
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x118(%rbp)
movl %eax, -0x11c(%rbp)
jmp 0x19d6f
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x118(%rbp)
movl %eax, -0x11c(%rbp)
jmp 0x19d66
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x118(%rbp)
movl %eax, -0x11c(%rbp)
jmp 0x19d5d
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x118(%rbp)
movl %eax, -0x11c(%rbp)
leaq -0x140(%rbp), %rdi
callq 0x69d8
leaq -0x50(%rbp), %rdi
callq 0x69d8
leaq -0x70(%rbp), %rdi
callq 0x69d8
leaq -0x90(%rbp), %rdi
callq 0x69d8
leaq -0xb0(%rbp), %rdi
callq 0x69d8
leaq -0xd0(%rbp), %rdi
callq 0x69d8
leaq -0xf0(%rbp), %rdi
callq 0x69d8
leaq -0x110(%rbp), %rdi
callq 0x69d8
jmp 0x19df0
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x118(%rbp)
movl %eax, -0x11c(%rbp)
leaq -0x30(%rbp), %rdi
callq 0x69d8
jmp 0x19df0
movl $0x0, -0x4(%rbp)
movl $0x1, -0x144(%rbp)
leaq -0x30(%rbp), %rdi
callq 0x69d8
movl -0x4(%rbp), %eax
addq $0x180, %rsp            # imm = 0x180
popq %rbp
retq
movq -0x118(%rbp), %rdi
callq 0x68a0
nopl (%rax)