// File: /workspace/github_cpp_makefile_star2_O1/menhits[P]phplus/src/utils/stringUtils.cpp
// Function: str::tabsToSpaces(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, int)
string tabsToSpaces(const string& in, int tabWidth)
{
	int widthSinceNewline=0;
	string out;
	int bytePos=0;
	int start=0;
	
	while (bytePos<(int)in.size())
	{
		if (subMatches(in, bytePos, "\t"))
		{
			out+=in.substr(start, bytePos-start);
			string spacer;
			int spaces=tabWidth-(widthSinceNewline%tabWidth);
			for (int i=0; i<spaces; i++)
				spacer+=" ";
			out+=spacer;
			widthSinceNewline+=spaces;
			nextGlyph(bytePos, in);
			start=bytePos;
		}
		else
		{
			widthSinceNewline++;
			if (subMatches(in, bytePos, "\n"))
			{
				widthSinceNewline=0;
			}
			nextGlyph(bytePos, in);
		}
	}
	
	out+=in.substr(start, bytePos-start);
	
	return out;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x48, %rsp
movl %edx, 0x3c(%rsp)
leaq 0x10(%rdi), %rax
movq %rax, (%rdi)
movq $0x0, 0x8(%rdi)
movq %rdi, 0x30(%rsp)
movb $0x0, 0x10(%rdi)
movq %rsi, (%rsp)
cmpl $0x0, 0x8(%rsi)
movq %rax, 0x40(%rsp)
jle 0x75878
leaq 0x10(%rsp), %r13
leaq 0x14b0(%rip), %r15      # 0x76a9c
xorl %r14d, %r14d
movl $0x0, 0xc(%rsp)
xorl %ebp, %ebp
leaq 0x20(%rsp), %rax
movq %rax, 0x10(%rsp)
movq %r13, %rdi
leaq 0x1441(%rip), %rsi      # 0x76a4e
leaq 0x143b(%rip), %rdx      # 0x76a4f
callq 0xdf6a
testl %ebp, %ebp
js 0x7567b
movq 0x18(%rsp), %rax
movl %ebp, %esi
leaq (%rax,%rsi), %rcx
movq (%rsp), %rdx
cmpq 0x8(%rdx), %rcx
ja 0x7567b
testl %eax, %eax
setle %r12b
jle 0x7567e
movq (%rsp), %rcx
movq (%rcx), %rcx
movq 0x10(%rsp), %rdx
movb (%rcx,%rsi), %dil
cmpb (%rdx), %dil
jne 0x7567b
andl $0x7fffffff, %eax       # imm = 0x7FFFFFFF
addq %rsi, %rcx
movl $0x1, %edi
movq %rdi, %rsi
cmpq %rdi, %rax
je 0x75672
movb (%rcx,%rsi), %r8b
leaq 0x1(%rsi), %rdi
cmpb (%rdx,%rsi), %r8b
je 0x7565c
cmpq %rax, %rsi
setae %r12b
jmp 0x7567e
xorl %r12d, %r12d
movq 0x10(%rsp), %rdi
leaq 0x20(%rsp), %rax
cmpq %rax, %rdi
je 0x75692
callq 0xa2b0
testb %r12b, %r12b
je 0x75767
movslq 0xc(%rsp), %rdx
movl %ebp, %eax
subl %edx, %eax
movslq %eax, %rcx
movq %r13, %rdi
movq (%rsp), %rsi
callq 0xa2f0
movq 0x10(%rsp), %rsi
movq 0x18(%rsp), %rdx
movq 0x30(%rsp), %rdi
callq 0xa110
movq 0x10(%rsp), %rdi
leaq 0x20(%rsp), %rax
cmpq %rax, %rdi
je 0x756db
callq 0xa2b0
leaq 0x20(%rsp), %rax
movq %rax, 0x10(%rsp)
movq $0x0, 0x18(%rsp)
movb $0x0, 0x20(%rsp)
movl %r14d, %eax
cltd
movl 0x3c(%rsp), %ebx
idivl %ebx
subl %edx, %ebx
movl %ebx, %r12d
jle 0x75714
movq %r13, %rdi
movq %r15, %rsi
callq 0xa560
decl %r12d
jne 0x75704
movq 0x10(%rsp), %rsi
movq 0x18(%rsp), %rdx
movq 0x30(%rsp), %rdi
callq 0xa110
addl %r14d, %ebx
movq (%rsp), %rcx
movslq 0x8(%rcx), %rax
movq (%rcx), %rcx
movslq %ebp, %rbp
leaq 0x1(%rbp), %rdx
cmpq %rax, %rdx
cmovgq %rdx, %rax
leaq -0x1(%rax), %rdx
cmpq %rbp, %rdx
je 0x7584b
movb 0x1(%rcx,%rbp), %sil
incq %rbp
andb $-0x40, %sil
negb %sil
jo 0x75748
jmp 0x7584e
leaq 0x20(%rsp), %rax
movq %rax, 0x10(%rsp)
movq %r13, %rdi
leaq 0x17ad(%rip), %rsi      # 0x76f28
leaq 0x17a7(%rip), %rdx      # 0x76f29
callq 0xdf6a
testl %ebp, %ebp
js 0x757e9
movq 0x18(%rsp), %rax
movl %ebp, %esi
leaq (%rax,%rsi), %rcx
movq (%rsp), %rdx
cmpq 0x8(%rdx), %rcx
ja 0x757e9
testl %eax, %eax
setle %r12b
jle 0x757ec
movq (%rsp), %rcx
movq (%rcx), %rcx
movq 0x10(%rsp), %rdx
movb (%rcx,%rsi), %dil
cmpb (%rdx), %dil
jne 0x757e9
andl $0x7fffffff, %eax       # imm = 0x7FFFFFFF
addq %rsi, %rcx
movl $0x1, %edi
movq %rdi, %rsi
cmpq %rdi, %rax
je 0x757e0
movb (%rcx,%rsi), %r8b
leaq 0x1(%rsi), %rdi
cmpb (%rdx,%rsi), %r8b
je 0x757ca
cmpq %rax, %rsi
setae %r12b
jmp 0x757ec
xorl %r12d, %r12d
movq 0x10(%rsp), %rdi
leaq 0x20(%rsp), %rax
cmpq %rax, %rdi
je 0x75800
callq 0xa2b0
incl %r14d
testb %r12b, %r12b
movl %r14d, %ebx
movl $0x0, %eax
cmovnel %eax, %ebx
movq (%rsp), %rcx
movslq 0x8(%rcx), %rax
movq (%rcx), %rcx
movslq %ebp, %rsi
leaq 0x1(%rsi), %rdx
cmpq %rax, %rdx
cmovleq %rax, %rdx
leaq 0x1(%rsi), %rbp
cmpq %rax, %rbp
jge 0x75846
movb 0x1(%rcx,%rsi), %sil
andb $-0x40, %sil
negb %sil
movq %rbp, %rsi
jo 0x7582a
jmp 0x75866
movq %rdx, %rbp
jmp 0x75866
movq %rax, %rbp
movq 0x10(%rsp), %rdi
leaq 0x20(%rsp), %rax
cmpq %rax, %rdi
je 0x75862
callq 0xa2b0
movl %ebp, 0xc(%rsp)
movl %ebx, %r14d
movq (%rsp), %rax
cmpl 0x8(%rax), %ebp
jl 0x755f9
jmp 0x75882
xorl %ebp, %ebp
movl $0x0, 0xc(%rsp)
movslq 0xc(%rsp), %rdx
subl %edx, %ebp
movslq %ebp, %rcx
leaq 0x10(%rsp), %rdi
movq (%rsp), %rsi
callq 0xa2f0
movq 0x10(%rsp), %rsi
movq 0x18(%rsp), %rdx
movq 0x30(%rsp), %rdi
callq 0xa110
leaq 0x20(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x758c1
callq 0xa2b0
movq 0x30(%rsp), %rax
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %r14
leaq 0x20(%rsp), %rax
movq -0x10(%rax), %rdi
jmp 0x758ff
jmp 0x758ed
jmp 0x758ed
jmp 0x758f2
jmp 0x758ed
jmp 0x758f2
movq %rax, %r14
jmp 0x75909
movq %rax, %r14
movq 0x10(%rsp), %rdi
leaq 0x20(%rsp), %rax
cmpq %rax, %rdi
je 0x75909
callq 0xa2b0
movq 0x30(%rsp), %rax
movq (%rax), %rdi
cmpq 0x40(%rsp), %rdi
je 0x7591d
callq 0xa2b0
movq %r14, %rdi
callq 0xa510