// File: /workspace/github_cpp_makefile_star2_O1/simonrharris[P]SKA/src/ska.cpp
// Function: humaniseSubcommand(int, char**)
int humaniseSubcommand(int argc, char *argv[]){

	std::string inputfile="";
	std::string outfile="humanised_kmers.tsv";

	for (int i=2; i<argc; ++i){

		std::string arg=(argv[i]);

		if (arg=="-h" || arg=="--help"){
			infoHelp();
			return 0;
		}
		else if (arg == "-i"){
			i++;
			if (i<argc){
				inputfile = argv[i];
			}
			else {
				std::cerr << std::endl << "Expecting file name after -i flag" << std::endl << std::endl;
				return 1;
			}
		}
		else if (arg == "-o"){
			i++;
			if (i<argc){
				outfile = std::string(argv[i])+".tsv";
			}
			else {
				std::cerr << std::endl << "Expecting file name after -o flag" << std::endl << std::endl;
				return 1;
			}
		}
		else if (arg[0]=='-'){
			std::cerr << std::endl << "Unrecognised flag " << arg << std::endl << std::endl;
			return 1;
		}
		else {
			std::cerr << std::endl << "Unrecognised argument " << arg << std::endl << std::endl;
			return 1;
		}
	}


	if (inputfile==""){
		std::cerr << std::endl << "Input kmer file is required" << std::endl;
		humaniseHelp();
		return 1;
	}

	if (humaniseKmers(inputfile, outfile)){return 1;}

	return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xb8, %rsp
movq %rsi, %r15
movl %edi, %r14d
leaq 0x18(%rsp), %rbx
movq %rbx, -0x10(%rbx)
leaq 0x76f7(%rip), %rdx      # 0x342b2
leaq 0x8(%rsp), %rdi
movq %rdx, %rsi
callq 0x862a
leaq 0x40(%rsp), %rax
movq %rax, -0x10(%rax)
leaq 0x9736(%rip), %rsi      # 0x3630e
leaq 0x9742(%rip), %rdx      # 0x36321
leaq 0x30(%rsp), %rdi
callq 0x862a
cmpl $0x3, %r14d
setge %bl
jl 0x2d086
movl $0x2, %ebp
leaq 0x50(%rsp), %r12
movl %r14d, 0x2c(%rsp)
movq %r15, 0x90(%rsp)
movslq %ebp, %rax
movq (%r15,%rax,8), %rsi
movq %r12, %rdi
leaq 0x70(%rsp), %rdx
callq 0x184a2
movq %r12, %rdi
leaq 0x8404(%rip), %rsi      # 0x3502f
callq 0x50f0
testl %eax, %eax
je 0x2cd2c
movq %r12, %rdi
leaq 0x83f0(%rip), %rsi      # 0x35032
callq 0x50f0
testl %eax, %eax
je 0x2cd2c
movq %r12, %rdi
leaq 0x8928(%rip), %rsi      # 0x35581
callq 0x50f0
testl %eax, %eax
je 0x2cd3c
movq %r12, %rdi
leaq 0x86c9(%rip), %rsi      # 0x35339
callq 0x50f0
testl %eax, %eax
je 0x2cd80
movq 0x50(%rsp), %rax
movq 0x14367(%rip), %rdx     # 0x40ff0
movq (%rdx), %rcx
movq -0x18(%rcx), %rdi
addq %rdx, %rdi
cmpb $0x2d, (%rax)
jne 0x2cdeb
movl $0xa, %esi
callq 0x53a0
movsbl %al, %esi
movq 0x14340(%rip), %rdi     # 0x40ff0
callq 0x5030
movq %rax, %rdi
callq 0x5250
movq %rax, %r13
movl $0x12, %edx
movq %rax, %rdi
leaq 0x8405(%rip), %rsi      # 0x350d4
callq 0x5420
movq 0x50(%rsp), %rsi
movq 0x58(%rsp), %rdx
movq %r13, %rdi
callq 0x5420
movq %rax, %r13
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r13, %rdi
movl $0xa, %esi
callq 0x53a0
movsbl %al, %esi
movq %r13, %rdi
callq 0x5030
movq %rax, %rdi
callq 0x5250
movq %rax, %r13
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r13, %rdi
movl $0xa, %esi
callq 0x53a0
jmp 0x2ce76
xorl %r13d, %r13d
callq 0x2d231
xorl %r14d, %r14d
jmp 0x2cfd2
incl %ebp
cmpl %r14d, %ebp
jge 0x2ce8e
movslq %ebp, %rax
movq (%r15,%rax,8), %r12
movq 0x10(%rsp), %r15
movq %r12, %rdi
callq 0x5180
movb $0x1, %r14b
leaq 0x8(%rsp), %rdi
xorl %esi, %esi
movq %r15, %rdx
movq 0x90(%rsp), %r15
movq %r12, %rcx
movq %rax, %r8
callq 0x55e0
jmp 0x2cfd2
incl %ebp
cmpl %r14d, %ebp
jge 0x2cf2e
movslq %ebp, %rax
movq (%r15,%rax,8), %rsi
leaq 0x98(%rsp), %r14
movq %r14, %rdi
leaq 0x7(%rsp), %rdx
callq 0x184a2
movq %r14, %rdi
leaq 0x6c5e(%rip), %rsi      # 0x33a0f
callq 0x5710
leaq 0x80(%rsp), %r14
movq %r14, 0x70(%rsp)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x2d011
movq %rdx, 0x70(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x80(%rsp)
jmp 0x2d018
movl $0xa, %esi
callq 0x53a0
movsbl %al, %esi
movq 0x141f1(%rip), %rdi     # 0x40ff0
callq 0x5030
movq %rax, %rdi
callq 0x5250
movq %rax, %r13
movl $0x16, %edx
movq %rax, %rdi
leaq 0x9526(%rip), %rsi      # 0x36344
callq 0x5420
movq 0x50(%rsp), %rsi
movq 0x58(%rsp), %rdx
movq %r13, %rdi
callq 0x5420
movq %rax, %r13
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r13, %rdi
movl $0xa, %esi
callq 0x53a0
movsbl %al, %esi
movq %r13, %rdi
callq 0x5030
movq %rax, %rdi
callq 0x5250
movq %rax, %r13
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r13, %rdi
movl $0xa, %esi
callq 0x53a0
movsbl %al, %esi
movq %r13, %rdi
callq 0x5030
movq %rax, %rdi
callq 0x5250
jmp 0x2cfc9
movq 0x1415b(%rip), %rcx     # 0x40ff0
movq (%rcx), %rax
movq -0x18(%rax), %rdi
addq %rcx, %rdi
movl $0xa, %esi
callq 0x53a0
movsbl %al, %esi
movq 0x1413d(%rip), %rdi     # 0x40ff0
callq 0x5030
movq %rax, %rdi
callq 0x5250
movq %rax, %r13
movl $0x21, %edx
movq %rax, %rdi
leaq 0x9450(%rip), %rsi      # 0x36322
callq 0x5420
movq (%r13), %rax
movq -0x18(%rax), %rdi
addq %r13, %rdi
movl $0xa, %esi
callq 0x53a0
movsbl %al, %esi
movq %r13, %rdi
callq 0x5030
movq %rax, %rdi
callq 0x5250
movq %rax, %r13
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r13, %rdi
movl $0xa, %esi
callq 0x53a0
movsbl %al, %esi
movq %r13, %rdi
callq 0x5030
movq %rax, %rdi
callq 0x5250
jmp 0x2cfc9
movq 0x140bb(%rip), %rcx     # 0x40ff0
movq (%rcx), %rax
movq -0x18(%rax), %rdi
addq %rcx, %rdi
movl $0xa, %esi
callq 0x53a0
movsbl %al, %esi
movq 0x1409d(%rip), %rdi     # 0x40ff0
callq 0x5030
movq %rax, %rdi
callq 0x5250
movq %rax, %r13
movl $0x21, %edx
movq %rax, %rdi
leaq 0x8612(%rip), %rsi      # 0x35584
callq 0x5420
movq (%r13), %rax
movq -0x18(%rax), %rdi
addq %r13, %rdi
movl $0xa, %esi
callq 0x53a0
movsbl %al, %esi
movq %r13, %rdi
callq 0x5030
movq %rax, %rdi
callq 0x5250
movq %rax, %r13
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r13, %rdi
movl $0xa, %esi
callq 0x53a0
movsbl %al, %esi
movq %r13, %rdi
callq 0x5030
movq %rax, %rdi
callq 0x5250
movl $0x1, %r13d
xorl %r14d, %r14d
movq 0x50(%rsp), %rdi
leaq 0x60(%rsp), %rax
cmpq %rax, %rdi
je 0x2cfee
movq 0x60(%rsp), %rsi
incq %rsi
callq 0x53c0
testb %r14b, %r14b
je 0x2d086
incl %ebp
movl 0x2c(%rsp), %r14d
cmpl %r14d, %ebp
setl %bl
leaq 0x50(%rsp), %r12
jl 0x2cc0d
jmp 0x2d086
movups (%rcx), %xmm0
movups %xmm0, (%r14)
movq 0x8(%rax), %rdx
movq %rdx, 0x78(%rsp)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
leaq 0x30(%rsp), %rdi
leaq 0x70(%rsp), %rsi
callq 0x5470
movq 0x70(%rsp), %rdi
cmpq %r14, %rdi
je 0x2d059
movq 0x80(%rsp), %rsi
incq %rsi
callq 0x53c0
movq 0x98(%rsp), %rdi
leaq 0xa8(%rsp), %rax
cmpq %rax, %rdi
je 0x2d07e
movq 0xa8(%rsp), %rsi
incq %rsi
callq 0x53c0
movb $0x1, %r14b
jmp 0x2cfd2
testb $0x1, %bl
jne 0x2d136
leaq 0x721c(%rip), %rsi      # 0x342b2
leaq 0x8(%rsp), %rdi
callq 0x50f0
testl %eax, %eax
je 0x2d0be
leaq 0x8(%rsp), %rdi
leaq 0x30(%rsp), %rsi
callq 0x19760
xorl %r13d, %r13d
testl %eax, %eax
setne %r13b
jmp 0x2d136
movq 0x13f2b(%rip), %rdi     # 0x40ff0
movq (%rdi), %rax
addq -0x18(%rax), %rdi
movl $0xa, %esi
callq 0x53a0
movsbl %al, %esi
movq 0x13f10(%rip), %rdi     # 0x40ff0
callq 0x5030
movq %rax, %rdi
callq 0x5250
movq %rax, %rbx
leaq 0x9264(%rip), %rsi      # 0x3635b
movl $0x1b, %edx
movq %rax, %rdi
callq 0x5420
movq (%rbx), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x53a0
movsbl %al, %esi
movq %rbx, %rdi
callq 0x5030
movq %rax, %rdi
callq 0x5250
movl $0x1, %r13d
callq 0x2c964
movq 0x30(%rsp), %rdi
leaq 0x40(%rsp), %rax
cmpq %rax, %rdi
je 0x2d152
movq 0x40(%rsp), %rsi
incq %rsi
callq 0x53c0
movq 0x8(%rsp), %rdi
leaq 0x18(%rsp), %rax
cmpq %rax, %rdi
je 0x2d16e
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x53c0
movl %r13d, %eax
addq $0xb8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x40(%rsp), %r12
leaq 0x18(%rsp), %r15
movq %rax, %rbx
movq 0x98(%rsp), %rdi
leaq 0xa8(%rsp), %rax
cmpq %rax, %rdi
je 0x2d1df
movq 0xa8(%rsp), %rsi
incq %rsi
callq 0x53c0
jmp 0x2d1df
jmp 0x2d1d2
movq %rbx, %r15
movq %rax, %rbx
jmp 0x2d212
jmp 0x2d1c3
leaq 0x40(%rsp), %r12
leaq 0x18(%rsp), %r15
movq %rax, %rbx
jmp 0x2d1fb
leaq 0x40(%rsp), %r12
leaq 0x18(%rsp), %r15
movq %rax, %rbx
movq 0x50(%rsp), %rdi
leaq 0x60(%rsp), %rax
cmpq %rax, %rdi
je 0x2d1fb
movq 0x60(%rsp), %rsi
incq %rsi
callq 0x53c0
movq 0x30(%rsp), %rdi
cmpq %r12, %rdi
je 0x2d212
movq 0x40(%rsp), %rsi
incq %rsi
callq 0x53c0
movq 0x8(%rsp), %rdi
cmpq %r15, %rdi
je 0x2d229
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x53c0
movq %rbx, %rdi
callq 0x56a0