// File: /workspace/github_cpp_makefile_star2_O3/lrq3000[P]rfrb/./src/fileHandler.cpp
// Function: FileHandler::userStripeMapInteraction(std::vector<std::vector<mapEntry, std::allocator<mapEntry>>, std::allocator<std::vector<mapEntry, std::allocator<mapEntry>>>>&)
void FileHandler::userStripeMapInteraction(std::vector<std::vector<mapEntry>> &stripingMap)
{
	bool finished=false;
	std::string answer;
	while (finished == false)
	{
		std::cout << "Found following stripemap: " << std::endl << std::endl;
		for (auto &in : stripingMap)
		{
			std::cout << std::setw(10) << " ";
			for (auto &it : in)
			{
				if (it.isParity)
				{
					std::cout << std::setw(4) << "P";
				}
				else
				{
					std::cout << std::setw(4) << std::to_string(it.dataBlock);
				}
			}
			std::cout << std::endl;
		}
		std::cout << std::endl << std::endl;
		std::cout << "Everything ok? [y/n]" << std::endl;
		std::getline(std::cin,answer);
		if (answer == "y" || answer == "yes" || answer == "Y")
		{
			finished=true;
		}
		else
		{
			std::cout << "Which line to change?" << std::endl;
			std::getline(std::cin,answer);
			size_t line = std::atoll(answer.c_str())-1;
			std::vector<mapEntry> tmp;
			if (line >= stripingMap.size())
			{
				std::cout << "Line not found" << std::endl;
			}
			else
			{
				size_t pos=0;
				std::cout << "Insert line like '0 1 P'(RAID5) or '0 1 2'(RAID0)" << std::endl;
				std::getline(std::cin,answer);
				answer += " ";
				while (pos != std::string::npos)
				{
					pos = answer.find_first_of(' ',pos+1);
					if (pos == std::string::npos)
						break;
					std::string ent = answer.substr(pos-1, 1);
					if (ent == "P")
					{
						tmp.push_back(mapEntry(true,inFiles.size()-1));
					}
					else
					{
						size_t t = std::atoll(ent.c_str());
						if (t >= stripingMap.at(0).size())
						{
							std::cout << "Invalid line" << std::endl;
						}
						tmp.push_back(mapEntry(false, t));
					}
				}
				if (tmp.size() != stripingMap.at(0).size())
				{
					std::cout << "Invalid line" << std::endl;
				}
				else
				{
					stripingMap.at(line) = tmp;
				}
			}
		}
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x88, %rsp
movq %rsi, %r15
leaq 0x78(%rsp), %rax
movq %rax, -0x10(%rax)
movq $0x0, -0x8(%rax)
movb $0x0, (%rax)
movq 0x11651(%rip), %r12     # 0x1cfb0
leaq 0x68(%rsp), %rbp
movq %rsi, 0x58(%rsp)
movq %rdi, 0x50(%rsp)
movl $0x1b, %edx
movq %r12, %rdi
leaq 0x94cb(%rip), %rsi      # 0x14e48
callq 0x5450
movq (%r12), %rax
movq -0x18(%rax), %rdi
addq %r12, %rdi
movl $0xa, %esi
callq 0x53b0
movsbl %al, %esi
movq %r12, %rdi
callq 0x5040
movq %rax, %rdi
callq 0x5260
movq %rax, %rbx
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x53b0
movsbl %al, %esi
movq %rbx, %rdi
callq 0x5040
movq %rax, %rdi
callq 0x5260
movq (%r15), %rbx
movq 0x8(%r15), %rax
movq %rax, 0x60(%rsp)
cmpq %rax, %rbx
je 0xbb58
movq (%r12), %rax
movq -0x18(%rax), %rax
movq $0xa, 0x10(%r12,%rax)
movl $0x1, %edx
movq %r12, %rdi
leaq 0x8b7b(%rip), %rsi      # 0x14584
callq 0x5450
movq (%rbx), %rbp
movq %rbx, 0x8(%rsp)
movq 0x8(%rbx), %r15
cmpq %r15, %rbp
je 0xbb17
movb (%rbp), %al
movq (%r12), %rcx
movq -0x18(%rcx), %rcx
movq $0x4, 0x10(%r12,%rcx)
cmpb $0x1, %al
jne 0xba54
movl $0x1, %edx
movq %r12, %rdi
leaq 0xa628(%rip), %rsi      # 0x16072
callq 0x5450
jmp 0xbb0e
movq %r12, %r14
movl 0x4(%rbp), %r13d
movl %r13d, %r12d
negl %r12d
cmovsl %r13d, %r12d
movl $0x1, %ebx
cmpl $0xa, %r12d
jb 0xbab2
movl $0x4, %ebx
movl %r12d, %eax
cmpl $0x63, %eax
jbe 0xbaab
cmpl $0x3e7, %eax            # imm = 0x3E7
jbe 0xbab0
cmpl $0x2710, %eax           # imm = 0x2710
jb 0xbab2
movl %eax, %ecx
movl $0xd1b71759, %edx       # imm = 0xD1B71759
imulq %rdx, %rcx
shrq $0x2d, %rcx
addl $0x4, %ebx
cmpl $0x1869f, %eax          # imm = 0x1869F
movl %ecx, %eax
ja 0xba78
addl $-0x3, %ebx
jmp 0xbab2
addl $-0x2, %ebx
jmp 0xbab2
decl %ebx
shrl $0x1f, %r13d
leal (%rbx,%r13), %esi
leaq 0x40(%rsp), %rax
movq %rax, 0x30(%rsp)
leaq 0x30(%rsp), %rdi
movl $0x2d, %edx
callq 0x5460
addq 0x30(%rsp), %r13
movq %r13, %rdi
movl %ebx, %esi
movl %r12d, %edx
callq 0x7ea0
movq 0x30(%rsp), %rsi
movq 0x38(%rsp), %rdx
movq %r14, %r12
movq %r14, %rdi
callq 0x5450
movq 0x30(%rsp), %rdi
leaq 0x40(%rsp), %rax
cmpq %rax, %rdi
je 0xbb0e
callq 0x5390
addq $0x8, %rbp
jmp 0xba1a
movq (%r12), %rax
movq -0x18(%rax), %rdi
addq %r12, %rdi
movl $0xa, %esi
callq 0x53b0
leaq 0x68(%rsp), %rbp
movq 0x8(%rsp), %rbx
movsbl %al, %esi
movq %r12, %rdi
callq 0x5040
movq %rax, %rdi
callq 0x5260
addq $0x18, %rbx
cmpq 0x60(%rsp), %rbx
jne 0xb9e9
movq (%r12), %rax
movq -0x18(%rax), %rdi
addq %r12, %rdi
movl $0xa, %esi
callq 0x53b0
movq 0x58(%rsp), %r15
movq 0x50(%rsp), %r14
movq 0x1145a(%rip), %r13     # 0x1cfd8
movsbl %al, %esi
movq %r12, %rdi
callq 0x5040
movq %rax, %rdi
callq 0x5260
movq %rax, %rbx
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x53b0
movsbl %al, %esi
movq %rbx, %rdi
callq 0x5040
movq %rax, %rdi
callq 0x5260
movl $0x14, %edx
movq %r12, %rdi
leaq 0x929a(%rip), %rsi      # 0x14e64
callq 0x5450
movq (%r12), %rax
movq -0x18(%rax), %rdi
addq %r12, %rdi
movl $0xa, %esi
callq 0x53b0
movsbl %al, %esi
movq %r12, %rdi
callq 0x5040
movq %rax, %rdi
callq 0x5260
movq (%r13), %rax
movq -0x18(%rax), %rdi
addq %r13, %rdi
movl $0xa, %esi
callq 0x53b0
movsbl %al, %edx
movq %r13, %rdi
movq %rbp, %rsi
callq 0x5670
movq %rbp, %rdi
leaq 0x85ae(%rip), %rsi      # 0x141d2
callq 0x50f0
testl %eax, %eax
je 0xbfa3
movq %rbp, %rdi
leaq 0x923e(%rip), %rsi      # 0x14e79
callq 0x50f0
testl %eax, %eax
je 0xbfa3
movq %rbp, %rdi
leaq 0x8586(%rip), %rsi      # 0x141d8
callq 0x50f0
testl %eax, %eax
je 0xbfa3
movl $0x15, %edx
movq %r12, %rdi
leaq 0x920f(%rip), %rsi      # 0x14e7d
callq 0x5450
movq (%r12), %rax
movq -0x18(%rax), %rdi
addq %r12, %rdi
movl $0xa, %esi
callq 0x53b0
movsbl %al, %esi
movq %r12, %rdi
callq 0x5040
movq %rax, %rdi
callq 0x5260
movq (%r13), %rax
movq -0x18(%rax), %rdi
addq %r13, %rdi
movl $0xa, %esi
callq 0x53b0
movsbl %al, %edx
movq %r13, %rdi
movq %rbp, %rsi
callq 0x5670
movq 0x68(%rsp), %rdi
callq 0x52c0
xorps %xmm0, %xmm0
movaps %xmm0, 0x10(%rsp)
movq $0x0, 0x20(%rsp)
movq 0x8(%r15), %rdx
subq (%r15), %rdx
decq %rax
sarq $0x3, %rdx
movabsq $-0x5555555555555555, %rcx # imm = 0xAAAAAAAAAAAAAAAB
imulq %rcx, %rdx
movq %rax, 0x8(%rsp)
cmpq %rdx, %rax
jae 0xbeae
movl $0x31, %edx
movq %r12, %rdi
leaq 0x9190(%rip), %rsi      # 0x14ea2
callq 0x5450
movq (%r12), %rax
movq -0x18(%rax), %rdi
addq %r12, %rdi
movl $0xa, %esi
callq 0x53b0
movsbl %al, %esi
movq %r12, %rdi
callq 0x5040
movq %rax, %rdi
callq 0x5260
movq (%r13), %rax
movq -0x18(%rax), %rdi
addq %r13, %rdi
movl $0xa, %esi
callq 0x53b0
movsbl %al, %edx
movq %r13, %rdi
movq %rbp, %rsi
callq 0x5670
movq %rbp, %rdi
leaq 0x8818(%rip), %rsi      # 0x14584
callq 0x5680
movl $0x1, %edx
movq %rbp, %rdi
movl $0x20, %esi
callq 0x54d0
movq %rax, %r13
cmpq $-0x1, %rax
je 0xbeef
leaq -0x1(%r13), %rdx
movl $0x1, %ecx
leaq 0x30(%rsp), %rbx
movq %rbx, %rdi
movq %rbp, %rsi
callq 0x5400
movq %rbx, %rdi
leaq 0xa2bf(%rip), %rsi      # 0x16072
callq 0x50f0
testl %eax, %eax
je 0xbe49
movq 0x30(%rsp), %rdi
callq 0x52c0
movq %rax, %rbx
movq (%r15), %rax
cmpq %rax, 0x8(%r15)
je 0xbfc9
movq 0x8(%rax), %rcx
subq (%rax), %rcx
sarq $0x3, %rcx
cmpq %rcx, %rbx
jb 0xbe26
movl $0xc, %edx
movq %r12, %rdi
leaq 0x90db(%rip), %rsi      # 0x14ed4
callq 0x5450
movq (%r12), %rax
movq -0x18(%rax), %rdi
addq %r12, %rdi
movl $0xa, %esi
callq 0x53b0
movsbl %al, %esi
movq %r12, %rdi
callq 0x5040
movq %rax, %rdi
callq 0x5260
movb $0x0, (%rsp)
movl %ebx, 0x4(%rsp)
movq 0x18(%rsp), %rsi
cmpq 0x20(%rsp), %rsi
jne 0xbe6b
leaq 0x10(%rsp), %rdi
movq %rsp, %rdx
callq 0xfa72
jmp 0xbe78
movq 0x48(%r14), %rax
subq 0x40(%r14), %rax
shrq $0x3, %rax
decl %eax
movb $0x1, (%rsp)
movl %eax, 0x4(%rsp)
movq 0x18(%rsp), %rsi
cmpq 0x20(%rsp), %rsi
je 0xbe9f
movq (%rsp), %rax
movq %rax, (%rsi)
addq $0x8, 0x18(%rsp)
movq 0x30(%rsp), %rdi
leaq 0x40(%rsp), %rax
cmpq %rax, %rdi
je 0xbe8c
callq 0x5390
incq %r13
movq %rbp, %rdi
movl $0x20, %esi
movq %r13, %rdx
jmp 0xbd7e
leaq 0x10(%rsp), %rdi
movq %rsp, %rdx
callq 0xfa72
jmp 0xbe78
movl $0xe, %edx
movq %r12, %rdi
leaq 0x8fd6(%rip), %rsi      # 0x14e93
callq 0x5450
movq (%r12), %rax
movq -0x18(%rax), %rdi
addq %r12, %rdi
movl $0xa, %esi
callq 0x53b0
movsbl %al, %esi
movq %r12, %rdi
callq 0x5040
movq %rax, %rdi
callq 0x5260
jmp 0xbf8b
movq (%r15), %rax
movq 0x8(%r15), %rcx
movq %rcx, %rdx
subq %rax, %rdx
sarq $0x3, %rdx
movabsq $-0x5555555555555555, %rsi # imm = 0xAAAAAAAAAAAAAAAB
imulq %rsi, %rdx
cmpq %rax, %rcx
je 0xbfdb
movq 0x18(%rsp), %rcx
subq 0x10(%rsp), %rcx
movq 0x8(%rax), %rsi
subq (%rax), %rsi
cmpq %rsi, %rcx
movq 0x8(%rsp), %rcx
jne 0xbf4f
cmpq %rcx, %rdx
jbe 0xbfe4
leaq (%rcx,%rcx,2), %rcx
leaq (%rax,%rcx,8), %rdi
leaq 0x10(%rsp), %rsi
callq 0xdd1e
jmp 0xbf8b
movl $0xc, %edx
movq %r12, %rdi
leaq 0x8f76(%rip), %rsi      # 0x14ed4
callq 0x5450
movq (%r12), %rax
movq -0x18(%rax), %rdi
addq %r12, %rdi
movl $0xa, %esi
callq 0x53b0
movsbl %al, %esi
movq %r12, %rdi
callq 0x5040
movq %rax, %rdi
callq 0x5260
movq 0x10(%rsp), %rdi
testq %rdi, %rdi
je 0xb96e
callq 0x5390
jmp 0xb96e
movq 0x68(%rsp), %rdi
leaq 0x78(%rsp), %rax
cmpq %rax, %rdi
je 0xbfb7
callq 0x5390
addq $0x88, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x88f9(%rip), %rdi      # 0x148c9
xorl %esi, %esi
xorl %edx, %edx
xorl %eax, %eax
callq 0x5570
movq $0x0, 0x8(%rsp)
leaq 0x88de(%rip), %rdi      # 0x148c9
movq 0x8(%rsp), %rsi
xorl %eax, %eax
callq 0x5570
jmp 0xc003
jmp 0xc008
jmp 0xc003
jmp 0xc008
jmp 0xc003
jmp 0xc008
movq %rax, %rbx
jmp 0xc01f
movq %rax, %rbx
movq 0x30(%rsp), %rdi
leaq 0x40(%rsp), %rax
cmpq %rax, %rdi
je 0xc01f
callq 0x5390
movq 0x10(%rsp), %rdi
testq %rdi, %rdi
je 0xc034
jmp 0xc062
jmp 0xc031
jmp 0xc031
jmp 0xc031
movq %rax, %rbx
movq 0x68(%rsp), %rdi
leaq 0x78(%rsp), %rax
cmpq %rax, %rdi
je 0xc048
callq 0x5390
movq %rbx, %rdi
callq 0x5650
movq %rax, %rbx
movq 0x30(%rsp), %rdi
leaq 0x40(%rsp), %rax
cmpq %rax, %rdi
je 0xc034
callq 0x5390
jmp 0xc034
nop