// File: statgen[P]statgen/lib/tclap-1.2.0/examples/../include/tclap/StdOutput.h
// Function: TCLAP::StdOutput::spacePrint(std::ostream&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, int, int, int) const
inline void StdOutput::spacePrint( std::ostream& os, 
						           const std::string& s, 
						           int maxWidth, 
						           int indentSpaces, 
						           int secondLineOffset ) const
{
	int len = static_cast<int>(s.length());

	if ( (len + indentSpaces > maxWidth) && maxWidth > 0 )
		{
			int allowedLen = maxWidth - indentSpaces;
			int start = 0;
			while ( start < len )
				{
					// find the substring length
					// int stringLen = std::min<int>( len - start, allowedLen );
					// doing it this way to support a VisualC++ 2005 bug 
					using namespace std; 
					int stringLen = min<int>( len - start, allowedLen );

					// trim the length so it doesn't end in middle of a word
					if ( stringLen == allowedLen )
						while ( stringLen >= 0 &&
								s[stringLen+start] != ' ' && 
								s[stringLen+start] != ',' &&
								s[stringLen+start] != '|' ) 
							stringLen--;
	
					// ok, the word is longer than the line, so just split 
					// wherever the line ends
					if ( stringLen <= 0 )
						stringLen = allowedLen;

					// check for newlines
					for ( int i = 0; i < stringLen; i++ )
						if ( s[start+i] == '\n' )
							stringLen = i+1;

					// print the indent	
					for ( int i = 0; i < indentSpaces; i++ )
						os << " ";

					if ( start == 0 )
						{
							// handle second line offsets
							indentSpaces += secondLineOffset;

							// adjust allowed len
							allowedLen -= secondLineOffset;
						}

					os << s.substr(start,stringLen) << std::endl;

					// so we don't start a line with a space
					while ( s[stringLen+start] == ' ' && start < len )
						start++;
			
					start += stringLen;
				}
		}
	else
		{
			for ( int i = 0; i < indentSpaces; i++ )
				os << " ";
			os << s << std::endl;
		}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xa0, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movl %ecx, -0x1c(%rbp)
movl %r8d, -0x20(%rbp)
movl %r9d, -0x24(%rbp)
movq -0x18(%rbp), %rdi
callq 0x4390
movl %eax, -0x28(%rbp)
movl -0x28(%rbp), %eax
addl -0x20(%rbp), %eax
cmpl -0x1c(%rbp), %eax
jle 0x968e
cmpl $0x0, -0x1c(%rbp)
jle 0x968e
movl -0x1c(%rbp), %eax
subl -0x20(%rbp), %eax
movl %eax, -0x2c(%rbp)
movl $0x0, -0x30(%rbp)
movl -0x30(%rbp), %eax
cmpl -0x28(%rbp), %eax
jge 0x968c
movl -0x28(%rbp), %eax
subl -0x30(%rbp), %eax
movl %eax, -0x38(%rbp)
leaq -0x38(%rbp), %rdi
leaq -0x2c(%rbp), %rsi
callq 0xb0d0
movl (%rax), %eax
movl %eax, -0x34(%rbp)
movl -0x34(%rbp), %eax
cmpl -0x2c(%rbp), %eax
jne 0x9535
jmp 0x94b8
xorl %eax, %eax
cmpl $0x0, -0x34(%rbp)
movb %al, -0x71(%rbp)
jl 0x951f
movq -0x18(%rbp), %rdi
movl -0x34(%rbp), %eax
addl -0x30(%rbp), %eax
movslq %eax, %rsi
callq 0x42d0
movsbl (%rax), %ecx
xorl %eax, %eax
cmpl $0x20, %ecx
movb %al, -0x71(%rbp)
je 0x951f
movq -0x18(%rbp), %rdi
movl -0x34(%rbp), %eax
addl -0x30(%rbp), %eax
movslq %eax, %rsi
callq 0x42d0
movsbl (%rax), %ecx
xorl %eax, %eax
cmpl $0x2c, %ecx
movb %al, -0x71(%rbp)
je 0x951f
movq -0x18(%rbp), %rdi
movl -0x34(%rbp), %eax
addl -0x30(%rbp), %eax
movslq %eax, %rsi
callq 0x42d0
movsbl (%rax), %eax
cmpl $0x7c, %eax
setne %al
movb %al, -0x71(%rbp)
movb -0x71(%rbp), %al
testb $0x1, %al
jne 0x9528
jmp 0x9533
movl -0x34(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0x34(%rbp)
jmp 0x94b8
jmp 0x9535
cmpl $0x0, -0x34(%rbp)
jg 0x9541
movl -0x2c(%rbp), %eax
movl %eax, -0x34(%rbp)
movl $0x0, -0x3c(%rbp)
movl -0x3c(%rbp), %eax
cmpl -0x34(%rbp), %eax
jge 0x9580
movq -0x18(%rbp), %rdi
movl -0x30(%rbp), %eax
addl -0x3c(%rbp), %eax
movslq %eax, %rsi
callq 0x42d0
movsbl (%rax), %eax
cmpl $0xa, %eax
jne 0x9573
movl -0x3c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x34(%rbp)
jmp 0x9575
movl -0x3c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x3c(%rbp)
jmp 0x9548
movl $0x0, -0x40(%rbp)
movl -0x40(%rbp), %eax
cmpl -0x20(%rbp), %eax
jge 0x95aa
movq -0x10(%rbp), %rdi
leaq 0x9e84(%rip), %rsi      # 0x1341e
callq 0x4250
movl -0x40(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x40(%rbp)
jmp 0x9587
cmpl $0x0, -0x30(%rbp)
jne 0x95c4
movl -0x24(%rbp), %eax
addl -0x20(%rbp), %eax
movl %eax, -0x20(%rbp)
movl -0x24(%rbp), %ecx
movl -0x2c(%rbp), %eax
subl %ecx, %eax
movl %eax, -0x2c(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x90(%rbp)
movq -0x18(%rbp), %rsi
movslq -0x30(%rbp), %rdx
movslq -0x34(%rbp), %rcx
leaq -0x60(%rbp), %rdi
movq %rdi, -0x88(%rbp)
callq 0x4280
movq -0x90(%rbp), %rdi
movq -0x88(%rbp), %rsi
callq 0x4230
movq %rax, -0x80(%rbp)
jmp 0x9604
movq -0x80(%rbp), %rdi
movq 0x119a1(%rip), %rsi     # 0x1afb0
callq 0x4290
jmp 0x9616
leaq -0x60(%rbp), %rdi
callq 0x44d8
movq -0x18(%rbp), %rdi
movl -0x34(%rbp), %eax
addl -0x30(%rbp), %eax
movslq %eax, %rsi
callq 0x42d0
movsbl (%rax), %ecx
xorl %eax, %eax
cmpl $0x20, %ecx
movb %al, -0x91(%rbp)
jne 0x9650
movl -0x30(%rbp), %eax
cmpl -0x28(%rbp), %eax
setl %al
movb %al, -0x91(%rbp)
movb -0x91(%rbp), %al
testb $0x1, %al
jne 0x965c
jmp 0x967e
movl -0x30(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x30(%rbp)
jmp 0x961f
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x68(%rbp)
movl %eax, -0x6c(%rbp)
leaq -0x60(%rbp), %rdi
callq 0x44d8
jmp 0x96dd
movl -0x34(%rbp), %eax
addl -0x30(%rbp), %eax
movl %eax, -0x30(%rbp)
jmp 0x9487
jmp 0x96d4
movl $0x0, -0x70(%rbp)
movl -0x70(%rbp), %eax
cmpl -0x20(%rbp), %eax
jge 0x96b8
movq -0x10(%rbp), %rdi
leaq 0x9d76(%rip), %rsi      # 0x1341e
callq 0x4250
movl -0x70(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x70(%rbp)
jmp 0x9695
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
callq 0x4230
movq %rax, %rdi
movq 0x118e1(%rip), %rsi     # 0x1afb0
callq 0x4290
addq $0xa0, %rsp
popq %rbp
retq
movq -0x68(%rbp), %rdi
callq 0x4420
nopw %cs:(%rax,%rax)