// File: /workspace/github_cpp_makefile_star2_O3/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, 0x40(%rsp)
movq %rax, (%rdi)
movq $0x0, 0x8(%rdi)
movq %rdi, 0x30(%rsp)
movb $0x0, 0x10(%rdi)
movq %rsi, (%rsp)
cmpl $0x0, 0x8(%rsi)
jle 0x767f4
leaq 0x10(%rsp), %r13
leaq 0x154d(%rip), %r15      # 0x77a9c
xorl %r14d, %r14d
movl $0x0, 0xc(%rsp)
xorl %ebp, %ebp
leaq 0x20(%rsp), %rax
movq %rax, 0x10(%rsp)
movq %r13, %rdi
leaq 0x14de(%rip), %rsi      # 0x77a4e
leaq 0x14d8(%rip), %rdx      # 0x77a4f
callq 0xdfa8
testl %ebp, %ebp
js 0x76599
movq 0x18(%rsp), %rax
movl %ebp, %ecx
leaq (%rax,%rcx), %rdx
movq (%rsp), %rsi
cmpq 0x8(%rsi), %rdx
jbe 0x766e5
xorl %r12d, %r12d
movq 0x10(%rsp), %rdi
leaq 0x20(%rsp), %rax
cmpq %rax, %rdi
je 0x765b0
callq 0xa2b0
testb %r12b, %r12b
je 0x76645
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 0x765f9
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 0x7672b
movq %r13, %rdi
movq %r15, %rsi
callq 0xa560
decl %r12d
jne 0x76626
movq 0x10(%rsp), %rsi
movq 0x18(%rsp), %rdx
jmp 0x76732
leaq 0x20(%rsp), %rax
movq %rax, 0x10(%rsp)
movq %r13, %rdi
leaq 0x18cf(%rip), %rsi      # 0x77f28
leaq 0x18c9(%rip), %rdx      # 0x77f29
callq 0xdfa8
testl %ebp, %ebp
js 0x76682
movq 0x18(%rsp), %rax
movl %ebp, %ecx
leaq (%rax,%rcx), %rdx
movq (%rsp), %rsi
cmpq 0x8(%rsi), %rdx
jbe 0x767a7
xorl %r12d, %r12d
movq 0x10(%rsp), %rdi
leaq 0x20(%rsp), %rax
cmpq %rax, %rdi
je 0x76699
callq 0xa2b0
incl %r14d
testb %r12b, %r12b
movl %r14d, %ebx
movl $0x0, %eax
cmovnel %eax, %ebx
movq (%rsp), %rax
movq (%rax), %rcx
movq 0x8(%rax), %rax
movslq %ebp, %rdi
movslq %eax, %rsi
leaq 0x1(%rdi), %rdx
cmpq %rsi, %rdx
cmovleq %rsi, %rdx
leaq 0x1(%rdi), %rbp
cmpq %rsi, %rbp
jge 0x76726
movb 0x1(%rcx,%rdi), %dil
andb $-0x40, %dil
negb %dil
movq %rbp, %rdi
jo 0x766c6
jmp 0x7679a
testl %eax, %eax
jle 0x767e4
movq 0x10(%rsp), %rdx
andl $0x7fffffff, %eax       # imm = 0x7FFFFFFF
movq (%rsp), %rsi
addq (%rsi), %rcx
decq %rax
xorl %esi, %esi
movb (%rcx,%rsi), %dil
cmpb (%rdx,%rsi), %dil
sete %r12b
jne 0x7659c
leaq 0x1(%rsi), %rdi
cmpq %rsi, %rax
movq %rdi, %rsi
jne 0x76703
jmp 0x7659c
movq %rdx, %rbp
jmp 0x7679a
xorl %edx, %edx
leaq 0x20(%rsp), %rsi
movq 0x30(%rsp), %rdi
callq 0xa110
addl %r14d, %ebx
movq (%rsp), %rax
movq (%rax), %rcx
movq 0x8(%rax), %rax
movslq %ebp, %rbp
movslq %eax, %rdx
leaq 0x1(%rbp), %rsi
cmpq %rdx, %rsi
cmovgq %rsi, %rdx
leaq -0x1(%rdx), %rsi
cmpq %rbp, %rsi
je 0x76777
movb 0x1(%rcx,%rbp), %dil
incq %rbp
andb $-0x40, %dil
negb %dil
jo 0x7675f
jmp 0x7677a
movq %rdx, %rbp
movq 0x10(%rsp), %rdi
leaq 0x20(%rsp), %rcx
cmpq %rcx, %rdi
je 0x76796
callq 0xa2b0
movq (%rsp), %rax
movq 0x8(%rax), %rax
movl %ebp, 0xc(%rsp)
movl %ebx, %r14d
cmpl %eax, %ebp
jl 0x7655c
jmp 0x767fe
testl %eax, %eax
jle 0x767ec
movq 0x10(%rsp), %rdx
andl $0x7fffffff, %eax       # imm = 0x7FFFFFFF
movq (%rsp), %rsi
addq (%rsi), %rcx
decq %rax
xorl %esi, %esi
movb (%rcx,%rsi), %dil
cmpb (%rdx,%rsi), %dil
sete %r12b
jne 0x76685
leaq 0x1(%rsi), %rdi
cmpq %rsi, %rax
movq %rdi, %rsi
jne 0x767c1
jmp 0x76685
movb $0x1, %r12b
jmp 0x7659c
movb $0x1, %r12b
jmp 0x76685
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 0x7683d
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 0x7687b
jmp 0x76869
jmp 0x76869
jmp 0x7686e
jmp 0x76869
jmp 0x7686e
movq %rax, %r14
jmp 0x76885
movq %rax, %r14
movq 0x10(%rsp), %rdi
leaq 0x20(%rsp), %rax
cmpq %rax, %rdi
je 0x76885
callq 0xa2b0
movq 0x30(%rsp), %rax
movq (%rax), %rdi
cmpq 0x40(%rsp), %rdi
je 0x76899
callq 0xa2b0
movq %r14, %rdi
callq 0xa510