// File: /workspace/github_cpp_makefile_star2_O1/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 $0x98, %rsp
movq %rsi, 0x30(%rsp)
movq %rdi, 0x80(%rsp)
leaq 0x70(%rsp), %rax
movq %rax, -0x10(%rax)
movq $0x0, -0x8(%rax)
movb $0x0, (%rax)
xorl %eax, %eax
movq 0x131a1(%rip), %r13     # 0x1efb0
leaq 0x38(%rsp), %rbp
movq %rax, 0x58(%rsp)
movl $0x1b, %edx
movq %r13, %rdi
leaq 0xa020(%rip), %rsi      # 0x15e48
callq 0x5450
movq (%r13), %rax
movq -0x18(%rax), %rdi
addq %r13, %rdi
movl $0xa, %esi
callq 0x53b0
movsbl %al, %esi
movq %r13, %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 0x30(%rsp), %rax
movq (%rax), %rbx
movq 0x8(%rax), %rax
movq %rax, 0x88(%rsp)
cmpq %rax, %rbx
je 0xc01e
movq (%r13), %rax
movq -0x18(%rax), %rax
movq $0xa, 0x10(%r13,%rax)
movl $0x1, %edx
movq %r13, %rdi
leaq 0x96c8(%rip), %rsi      # 0x15584
callq 0x5450
movq (%rbx), %r14
movq %rbx, 0x90(%rsp)
movq 0x8(%rbx), %rbx
cmpq %rbx, %r14
movq %rbx, 0x8(%rsp)
je 0xbfdc
movb (%r14), %al
movq (%r13), %rcx
movq -0x18(%rcx), %rcx
movq $0x4, 0x10(%r13,%rcx)
cmpb $0x1, %al
jne 0xbf0f
movl $0x1, %edx
movq %r13, %rdi
leaq 0xb65c(%rip), %rsi      # 0x17561
callq 0x5450
jmp 0xbfcf
movq %r13, %r15
movl 0x4(%r14), %r12d
movl %r12d, %ebx
negl %ebx
cmovsl %r12d, %ebx
movl $0x1, %r13d
cmpl $0xa, %ebx
jb 0xbf70
movl $0x4, %r13d
movl %ebx, %eax
cmpl $0x63, %eax
jbe 0xbf67
cmpl $0x3e7, %eax            # imm = 0x3E7
jbe 0xbf6d
cmpl $0x2710, %eax           # imm = 0x2710
jb 0xbf70
movl %eax, %ecx
movl $0xd1b71759, %edx       # imm = 0xD1B71759
imulq %rdx, %rcx
shrq $0x2d, %rcx
addl $0x4, %r13d
cmpl $0x1869f, %eax          # imm = 0x1869F
movl %ecx, %eax
ja 0xbf32
addl $-0x3, %r13d
jmp 0xbf70
addl $-0x2, %r13d
jmp 0xbf70
decl %r13d
shrl $0x1f, %r12d
leal (%r12,%r13), %esi
leaq 0x48(%rsp), %rax
movq %rax, 0x38(%rsp)
movq %rbp, %rdi
movl $0x2d, %edx
callq 0x5460
addq 0x38(%rsp), %r12
movq %r12, %rdi
movl %r13d, %esi
movl %ebx, %edx
callq 0x7ed8
movq 0x38(%rsp), %rsi
movq 0x40(%rsp), %rdx
movq %r15, %r13
movq %r15, %rdi
callq 0x5450
movq 0x38(%rsp), %rdi
leaq 0x48(%rsp), %rax
cmpq %rax, %rdi
je 0xbfca
callq 0x5390
movq 0x8(%rsp), %rbx
addq $0x8, %r14
cmpq %rbx, %r14
jne 0xbede
movq (%r13), %rax
movq -0x18(%rax), %rdi
addq %r13, %rdi
movl $0xa, %esi
callq 0x53b0
movq 0x90(%rsp), %rbx
movsbl %al, %esi
movq %r13, %rdi
callq 0x5040
movq %rax, %rdi
callq 0x5260
addq $0x18, %rbx
cmpq 0x88(%rsp), %rbx
jne 0xbe9c
movq (%r13), %rax
movq -0x18(%rax), %rdi
addq %r13, %rdi
movl $0xa, %esi
callq 0x53b0
movq 0x12f9e(%rip), %r14     # 0x1efd8
movsbl %al, %esi
movq %r13, %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 %r13, %rdi
leaq 0x9dde(%rip), %rsi      # 0x15e64
callq 0x5450
movq (%r13), %rax
movq -0x18(%rax), %rdi
addq %r13, %rdi
movl $0xa, %esi
callq 0x53b0
movsbl %al, %esi
movq %r13, %rdi
callq 0x5040
movq %rax, %rdi
callq 0x5260
movq (%r14), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x53b0
movsbl %al, %edx
movq %r14, %rdi
leaq 0x60(%rsp), %rsi
callq 0x5670
leaq 0x60(%rsp), %r15
movq %r15, %rdi
leaq 0x90ec(%rip), %rsi      # 0x151d2
callq 0x50f0
movb $0x1, %bl
testl %eax, %eax
je 0xc48a
movq %r15, %rdi
leaq 0x9d7a(%rip), %rsi      # 0x15e79
callq 0x50f0
testl %eax, %eax
je 0xc48a
movq %r15, %rdi
leaq 0x90c2(%rip), %rsi      # 0x151d8
callq 0x50f0
testl %eax, %eax
je 0xc48a
movl $0x15, %edx
movq %r13, %rdi
leaq 0x9d4b(%rip), %rsi      # 0x15e7d
callq 0x5450
movq (%r13), %rax
movq -0x18(%rax), %rdi
addq %r13, %rdi
movl $0xa, %esi
callq 0x53b0
movsbl %al, %esi
movq %r13, %rdi
callq 0x5040
movq %rax, %rdi
callq 0x5260
movq (%r14), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x53b0
movsbl %al, %edx
movq %r14, %rdi
leaq 0x60(%rsp), %rsi
callq 0x5670
movq 0x60(%rsp), %rdi
callq 0x52c0
xorps %xmm0, %xmm0
movaps %xmm0, 0x10(%rsp)
movq $0x0, 0x20(%rsp)
movq 0x30(%rsp), %rcx
movq 0x8(%rcx), %rdx
subq (%rcx), %rdx
decq %rax
sarq $0x3, %rdx
movabsq $-0x5555555555555555, %rcx # imm = 0xAAAAAAAAAAAAAAAB
imulq %rcx, %rdx
cmpq %rdx, %rax
jae 0xc391
movq %rax, 0x8(%rsp)
movl $0x31, %edx
movq %r13, %rdi
leaq 0x9cc6(%rip), %rsi      # 0x15ea2
callq 0x5450
movq 0x58(%rsp), %r15
movq (%r13), %rax
movq -0x18(%rax), %rdi
addq %r13, %rdi
movl $0xa, %esi
callq 0x53b0
movsbl %al, %esi
movq %r13, %rdi
callq 0x5040
movq %rax, %rdi
callq 0x5260
movq (%r14), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x53b0
movsbl %al, %edx
movq %r14, %rdi
leaq 0x60(%rsp), %rsi
callq 0x5670
leaq 0x60(%rsp), %rdi
leaq 0x9346(%rip), %rsi      # 0x15584
callq 0x5680
movl $0x1, %edx
leaq 0x60(%rsp), %r14
movq %r14, %rdi
movl $0x20, %esi
callq 0x54d0
movq %rax, %r12
cmpq $-0x1, %rax
je 0xc3d7
leaq -0x1(%r12), %rdx
movl $0x1, %ecx
movq %rbp, %rdi
movq %r14, %rsi
callq 0x5400
movq %rbp, %rdi
leaq 0xb2db(%rip), %rsi      # 0x17561
callq 0x50f0
testl %eax, %eax
je 0xc324
movq 0x38(%rsp), %rdi
callq 0x52c0
movq %rax, %rbx
movq 0x30(%rsp), %rcx
movq (%rcx), %rax
movq 0x8(%rcx), %rdx
subq %rax, %rdx
je 0xc4bb
movq 0x8(%rax), %rcx
subq (%rax), %rcx
sarq $0x3, %rcx
cmpq %rcx, %rbx
jb 0xc301
movl $0xc, %edx
movq %r13, %rdi
leaq 0x9c00(%rip), %rsi      # 0x15ed4
callq 0x5450
movq (%r13), %rax
movq -0x18(%rax), %rdi
addq %r13, %rdi
movl $0xa, %esi
callq 0x53b0
movsbl %al, %esi
movq %r13, %rdi
callq 0x5040
movq %rax, %rdi
callq 0x5260
movb $0x0, (%rsp)
movl %ebx, 0x4(%rsp)
movq 0x18(%rsp), %rsi
cmpq 0x20(%rsp), %rsi
jne 0xc34e
leaq 0x10(%rsp), %rdi
movq %rsp, %rdx
callq 0x102fa
jmp 0xc35b
movq 0x80(%rsp), %rcx
movq 0x48(%rcx), %rax
subq 0x40(%rcx), %rax
shrq $0x3, %rax
decl %eax
movb $0x1, (%rsp)
movl %eax, 0x4(%rsp)
movq 0x18(%rsp), %rsi
cmpq 0x20(%rsp), %rsi
je 0xc382
movq (%rsp), %rax
movq %rax, (%rsi)
addq $0x8, 0x18(%rsp)
movq 0x38(%rsp), %rdi
leaq 0x48(%rsp), %rax
cmpq %rax, %rdi
je 0xc36f
callq 0x5390
incq %r12
movq %r14, %rdi
movl $0x20, %esi
movq %r12, %rdx
jmp 0xc255
leaq 0x10(%rsp), %rdi
movq %rsp, %rdx
callq 0x102fa
jmp 0xc35b
movl $0xe, %edx
movq %r13, %rdi
leaq 0x9af3(%rip), %rsi      # 0x15e93
callq 0x5450
movq 0x58(%rsp), %r15
movq (%r13), %rax
movq -0x18(%rax), %rdi
addq %r13, %rdi
movl $0xa, %esi
callq 0x53b0
movsbl %al, %esi
movq %r13, %rdi
callq 0x5040
movq %rax, %rdi
callq 0x5260
jmp 0xc478
movq 0x30(%rsp), %rcx
movq (%rcx), %rax
movq 0x8(%rcx), %rcx
movq %rcx, %rdx
subq %rax, %rdx
sarq $0x3, %rdx
movabsq $-0x5555555555555555, %rsi # imm = 0xAAAAAAAAAAAAAAAB
imulq %rsi, %rdx
cmpq %rax, %rcx
movq 0x8(%rsp), %rdi
je 0xc4dd
movq 0x18(%rsp), %rcx
subq 0x10(%rsp), %rcx
movq 0x8(%rax), %rsi
subq (%rax), %rsi
cmpq %rsi, %rcx
jne 0xc43c
cmpq %rdi, %rdx
jbe 0xc4e6
leaq (%rdi,%rdi,2), %rcx
leaq (%rax,%rcx,8), %rdi
leaq 0x10(%rsp), %rsi
callq 0xe550
jmp 0xc478
movl $0xc, %edx
movq %r13, %rdi
leaq 0x9a89(%rip), %rsi      # 0x15ed4
callq 0x5450
movq (%r13), %rax
movq -0x18(%rax), %rdi
addq %r13, %rdi
movl $0xa, %esi
callq 0x53b0
movsbl %al, %esi
movq %r13, %rdi
callq 0x5040
movq %rax, %rdi
callq 0x5260
movq 0x10(%rsp), %rdi
testq %rdi, %rdi
je 0xc487
callq 0x5390
movl %r15d, %ebx
movl %ebx, %eax
testb $0x1, %bl
je 0xbe14
movq 0x60(%rsp), %rdi
leaq 0x70(%rsp), %rax
cmpq %rax, %rdi
je 0xc4a9
callq 0x5390
addq $0x98, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
sarq $0x3, %rdx
movabsq $-0x5555555555555555, %rax # imm = 0xAAAAAAAAAAAAAAAB
imulq %rax, %rdx
leaq 0x93f5(%rip), %rdi      # 0x158c9
xorl %esi, %esi
xorl %eax, %eax
callq 0x5570
movq $0x0, 0x8(%rsp)
leaq 0x93dc(%rip), %rdi      # 0x158c9
movq 0x8(%rsp), %rsi
xorl %eax, %eax
callq 0x5570
jmp 0xc505
jmp 0xc50a
jmp 0xc505
jmp 0xc50a
jmp 0xc505
jmp 0xc50a
movq %rax, %rbx
jmp 0xc521
movq %rax, %rbx
movq 0x38(%rsp), %rdi
leaq 0x48(%rsp), %rax
cmpq %rax, %rdi
je 0xc521
callq 0x5390
movq 0x10(%rsp), %rdi
testq %rdi, %rdi
jne 0xc543
jmp 0xc54f
jmp 0xc54c
jmp 0xc54c
movq %rax, %rbx
movq 0x38(%rsp), %rdi
leaq 0x48(%rsp), %rax
cmpq %rax, %rdi
je 0xc54f
callq 0x5390
jmp 0xc54f
jmp 0xc54c
movq %rax, %rbx
movq 0x60(%rsp), %rdi
leaq 0x70(%rsp), %rax
cmpq %rax, %rdi
je 0xc563
callq 0x5390
movq %rbx, %rdi
callq 0x5650
nop