// File: /workspace/github_cpp_makefile_star2_O3/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, 0x28(%rsp)
movl %edi, %ebp
leaq 0x18(%rsp), %rax
movq %rax, -0x10(%rax)
leaq 0x7c06(%rip), %rdx      # 0x342a2
leaq 0x8(%rsp), %rdi
movq %rdx, %rsi
callq 0x85fc
leaq 0x88(%rsp), %r14
movq %r14, -0x10(%r14)
leaq 0x9c42(%rip), %rsi      # 0x362fe
leaq 0x9c4e(%rip), %rdx      # 0x36311
leaq 0x78(%rsp), %rdi
callq 0x85fc
cmpl $0x3, %ebp
jl 0x2cb5f
movl $0x2, %ebx
leaq 0x48(%rsp), %r12
leaq 0x38(%rsp), %r15
movl %ebp, 0x34(%rsp)
movslq %ebx, %rax
movq 0x28(%rsp), %rcx
movq (%rcx,%rax,8), %rsi
movq %r15, %rdi
leaq 0x58(%rsp), %rdx
callq 0x182e0
movq %r15, %rdi
leaq 0x8913(%rip), %rsi      # 0x3501f
callq 0x50f0
testl %eax, %eax
je 0x2c80d
movq %r15, %rdi
leaq 0x88ff(%rip), %rsi      # 0x35022
callq 0x50f0
testl %eax, %eax
je 0x2c80d
movq %r15, %rdi
leaq 0x8e37(%rip), %rsi      # 0x35571
callq 0x50f0
testl %eax, %eax
je 0x2c81c
movq %r15, %rdi
leaq 0x8bd8(%rip), %rsi      # 0x35329
callq 0x50f0
testl %eax, %eax
je 0x2c869
movq 0x38(%rsp), %rax
movq 0x14886(%rip), %rdx     # 0x40ff0
movq (%rdx), %rcx
movq -0x18(%rcx), %rdi
addq %rdx, %rdi
cmpb $0x2d, (%rax)
jne 0x2c8d2
movl $0xa, %esi
callq 0x53a0
movsbl %al, %esi
movq 0x1485f(%rip), %rdi     # 0x40ff0
callq 0x5030
movq %rax, %rdi
callq 0x5250
movq %rax, %r13
movl $0x12, %edx
movq %rax, %rdi
leaq 0x8914(%rip), %rsi      # 0x350c4
callq 0x5420
movq 0x38(%rsp), %rsi
movq 0x40(%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 0x2c95d
xorl %r13d, %r13d
callq 0x2cd04
xorl %ebp, %ebp
jmp 0x2cab8
incl %ebx
cmpl %ebp, %ebx
jge 0x2c975
movslq %ebx, %rax
movq 0x28(%rsp), %rcx
movq (%rcx,%rax,8), %r12
movq 0x10(%rsp), %r15
movq %r12, %rdi
callq 0x5180
movb $0x1, %bpl
leaq 0x8(%rsp), %rdi
xorl %esi, %esi
movq %r15, %rdx
leaq 0x88(%rsp), %r14
movq %r12, %rcx
leaq 0x48(%rsp), %r12
movq %rax, %r8
callq 0x55e0
jmp 0x2cab8
incl %ebx
cmpl %ebp, %ebx
jge 0x2ca15
movslq %ebx, %rax
movq 0x28(%rsp), %rcx
movq (%rcx,%rax,8), %rsi
leaq 0x98(%rsp), %r15
movq %r15, %rdi
leaq 0x7(%rsp), %rdx
callq 0x182e0
movq %r15, %rdi
leaq 0x71a9(%rip), %rsi      # 0x33a47
callq 0x5710
leaq 0x68(%rsp), %rbp
movq %rbp, 0x58(%rsp)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x2caed
movq %rdx, 0x58(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x68(%rsp)
jmp 0x2caf4
movl $0xa, %esi
callq 0x53a0
movsbl %al, %esi
movq 0x1470a(%rip), %rdi     # 0x40ff0
callq 0x5030
movq %rax, %rdi
callq 0x5250
movq %rax, %r13
movl $0x16, %edx
movq %rax, %rdi
leaq 0x9a2f(%rip), %rsi      # 0x36334
callq 0x5420
movq 0x38(%rsp), %rsi
movq 0x40(%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 0x2cab0
movq 0x14674(%rip), %rcx     # 0x40ff0
movq (%rcx), %rax
movq -0x18(%rax), %rdi
addq %rcx, %rdi
movl $0xa, %esi
callq 0x53a0
movsbl %al, %esi
movq 0x14656(%rip), %rdi     # 0x40ff0
callq 0x5030
movq %rax, %rdi
callq 0x5250
movq %rax, %r13
movl $0x21, %edx
movq %rax, %rdi
leaq 0x9959(%rip), %rsi      # 0x36312
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 0x2cab0
movq 0x145d4(%rip), %rcx     # 0x40ff0
movq (%rcx), %rax
movq -0x18(%rax), %rdi
addq %rcx, %rdi
movl $0xa, %esi
callq 0x53a0
movsbl %al, %esi
movq 0x145b6(%rip), %rdi     # 0x40ff0
callq 0x5030
movq %rax, %rdi
callq 0x5250
movq %rax, %r13
movl $0x21, %edx
movq %rax, %rdi
leaq 0x8b1b(%rip), %rsi      # 0x35574
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 %ebp, %ebp
movq 0x38(%rsp), %rdi
cmpq %r12, %rdi
je 0x2cacf
movq 0x48(%rsp), %rsi
incq %rsi
callq 0x53c0
testb %bpl, %bpl
je 0x2cc15
incl %ebx
movl 0x34(%rsp), %ebp
cmpl %ebp, %ebx
leaq 0x38(%rsp), %r15
jl 0x2c6e9
jmp 0x2cb5f
movups (%rcx), %xmm0
movups %xmm0, (%rbp)
movq 0x8(%rax), %rdx
movq %rdx, 0x60(%rsp)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
leaq 0x78(%rsp), %rdi
leaq 0x58(%rsp), %rsi
callq 0x5470
movq 0x58(%rsp), %rdi
cmpq %rbp, %rdi
je 0x2cb32
movq 0x68(%rsp), %rsi
incq %rsi
callq 0x53c0
movq 0x98(%rsp), %rdi
leaq 0xa8(%rsp), %rax
cmpq %rax, %rdi
je 0x2cb57
movq 0xa8(%rsp), %rsi
incq %rsi
callq 0x53c0
movb $0x1, %bpl
jmp 0x2cab8
leaq 0x773c(%rip), %rsi      # 0x342a2
leaq 0x8(%rsp), %rdi
callq 0x50f0
testl %eax, %eax
je 0x2cb96
leaq 0x8(%rsp), %rdi
leaq 0x78(%rsp), %rsi
leaq 0x18(%rsp), %r15
callq 0x19578
xorl %r13d, %r13d
testl %eax, %eax
setne %r13b
jmp 0x2cc1a
movq 0x14453(%rip), %rdi     # 0x40ff0
movq (%rdi), %rax
addq -0x18(%rax), %rdi
movl $0xa, %esi
leaq 0x18(%rsp), %r15
callq 0x53a0
movsbl %al, %esi
movq 0x14433(%rip), %rdi     # 0x40ff0
callq 0x5030
movq %rax, %rdi
callq 0x5250
movq %rax, %rbx
leaq 0x9777(%rip), %rsi      # 0x3634b
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 0x2c444
jmp 0x2cc1a
leaq 0x18(%rsp), %r15
movq 0x78(%rsp), %rdi
cmpq %r14, %rdi
je 0x2cc34
movq 0x88(%rsp), %rsi
incq %rsi
callq 0x53c0
movq 0x8(%rsp), %rdi
cmpq %r15, %rdi
je 0x2cc4b
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 0x18(%rsp), %r15
movq %rax, %rbx
movq 0x98(%rsp), %rdi
leaq 0xa8(%rsp), %rax
cmpq %rax, %rdi
je 0x2ccaf
movq 0xa8(%rsp), %rsi
incq %rsi
callq 0x53c0
jmp 0x2ccaf
jmp 0x2cca7
leaq 0x18(%rsp), %r15
movq %rax, %rbx
jmp 0x2cce5
jmp 0x2cca2
leaq 0x18(%rsp), %r15
movq %rax, %rbx
jmp 0x2cccb
leaq 0x18(%rsp), %r15
movq %rax, %rbx
movq 0x38(%rsp), %rdi
leaq 0x48(%rsp), %rax
cmpq %rax, %rdi
je 0x2cccb
movq 0x48(%rsp), %rsi
incq %rsi
callq 0x53c0
movq 0x78(%rsp), %rdi
cmpq %r14, %rdi
je 0x2cce5
movq 0x88(%rsp), %rsi
incq %rsi
callq 0x53c0
movq 0x8(%rsp), %rdi
cmpq %r15, %rdi
je 0x2ccfc
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x53c0
movq %rbx, %rdi
callq 0x56a0