// File: /workspace/github_cpp_makefile_star2_O1/menhits[P]phplus/src/PhplusStdLib.cpp
// Function: addToProgStrToDub(CppProgram*)
void addToProgStrToDub(CppProgram * prog)
{
	if (!prog->hasFunc("$strToDub"))
	{
		string strType=prog->getTypeCode(String);
		
		prog->addFunc("$strToDub", {{strType, "in"}}, "double",
			"double out = 0;\n"
			"int divider = 1;\n"
			"for (int i = 0; i < in._size; i++)\n"
			"{\n"
			"	if (divider == 1)\n"
			"	{\n"
			"		if (in._data[i] >= '0' && in._data[i] <= '9')\n"
			"			out = out * 10 + in._data[i] - '0';\n"
			"		else if (in._data[i] == '.')\n"
			"			divider = 10;\n"
			"	}\n"
			"	else\n"
			"	{\n"
			"		if (in._data[i] >= '0' && in._data[i] <= '9')\n"
			"		{\n"
			"			out += ((double)(in._data[i] - '0')) / (double)divider;\n"
			"			divider *= 10;\n"
			"		}\n"
			"	}\n"
			"}\n"
			"if (in._size > 0 && in._data[0] == '-')\n"
			"	out *= -1;\n"
			"return out;\n"
		);
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xf8, %rsp
movq %rdi, %rbx
leaq 0x88(%rsp), %r14
movq %r14, -0x10(%r14)
leaq 0x4a7f5(%rip), %rsi     # 0x793b3
leaq 0x4a7f7(%rip), %rdx     # 0x793bc
leaq 0x78(%rsp), %rdi
callq 0xdf6a
leaq 0x78(%rsp), %rsi
movq %rbx, %rdi
callq 0x1c806
movl %eax, %ebp
movq 0x78(%rsp), %rdi
cmpq %r14, %rdi
je 0x2ebed
callq 0xa2b0
testb %bpl, %bpl
jne 0x2ed7c
leaq 0x6a863(%rip), %rax     # 0x99460
movq (%rax), %rcx
movq 0x8(%rax), %rax
movq %rcx, 0x10(%rsp)
movq %rax, 0x18(%rsp)
testq %rax, %rax
je 0x2ec28
movq 0x6a38e(%rip), %rcx     # 0x98fa8
cmpb $0x0, (%rcx)
je 0x2ec24
incl 0x8(%rax)
jmp 0x2ec28
lock
incl 0x8(%rax)
leaq 0xd8(%rsp), %rdi
leaq 0x10(%rsp), %rdx
movq %rbx, %rsi
callq 0x1a7f4
movq 0x18(%rsp), %rdi
testq %rdi, %rdi
je 0x2ec4c
callq 0xdcba
leaq 0xc8(%rsp), %r15
movq %r15, -0x10(%r15)
leaq 0x4a754(%rip), %rsi     # 0x793b3
leaq 0x4a756(%rip), %rdx     # 0x793bc
leaq 0xb8(%rsp), %rdi
callq 0xdf6a
leaq 0x48233(%rip), %rdx     # 0x76ead
leaq 0x78(%rsp), %rdi
leaq 0xd8(%rsp), %rsi
callq 0x4e30c
leaq 0x20(%rsp), %rdi
leaq 0x78(%rsp), %rsi
leaq 0xf(%rsp), %rcx
movl $0x1, %edx
callq 0x4e2a2
leaq 0x68(%rsp), %r12
movq %r12, -0x10(%r12)
leaq 0x47f52(%rip), %rsi     # 0x76c08
leaq 0x47f51(%rip), %rdx     # 0x76c0e
leaq 0x58(%rsp), %rdi
callq 0xdf6a
leaq 0x48(%rsp), %r13
movq %r13, -0x10(%r13)
leaq 0x4a6e6(%rip), %rsi     # 0x793bd
leaq 0x4a898(%rip), %rdx     # 0x79576
leaq 0x38(%rsp), %rdi
callq 0xdf6a
leaq 0xb8(%rsp), %rsi
leaq 0x20(%rsp), %rdx
leaq 0x58(%rsp), %rcx
leaq 0x38(%rsp), %r8
movq %rbx, %rdi
callq 0x1c826
movq 0x38(%rsp), %rdi
cmpq %r13, %rdi
je 0x2ed16
callq 0xa2b0
movq 0x58(%rsp), %rdi
cmpq %r12, %rdi
je 0x2ed25
callq 0xa2b0
leaq 0x20(%rsp), %rdi
callq 0x4e2e4
leaq 0xa8(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x2ed45
callq 0xa2b0
movq 0x78(%rsp), %rdi
cmpq %r14, %rdi
je 0x2ed54
callq 0xa2b0
movq 0xb8(%rsp), %rdi
cmpq %r15, %rdi
je 0x2ed66
callq 0xa2b0
leaq 0xe8(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x2ed7c
callq 0xa2b0
addq $0xf8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
movq 0x38(%rsp), %rdi
cmpq %r13, %rdi
je 0x2eda5
callq 0xa2b0
jmp 0x2eda5
movq %rax, %rbx
movq 0x58(%rsp), %rdi
cmpq %r12, %rdi
je 0x2edb9
callq 0xa2b0
jmp 0x2edb9
movq %rax, %rbx
leaq 0x20(%rsp), %rdi
callq 0x4e2e4
jmp 0x2edc8
movq %rax, %rbx
leaq 0x78(%rsp), %rdi
callq 0x4e278
jmp 0x2edd7
movq %rax, %rbx
movq 0xb8(%rsp), %rdi
cmpq %r15, %rdi
je 0x2edee
callq 0xa2b0
jmp 0x2edee
movq %rax, %rbx
leaq 0xe8(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
jne 0x2ee22
jmp 0x2ee2c
movq %rax, %rbx
movq 0x18(%rsp), %rdi
testq %rdi, %rdi
je 0x2ee2c
callq 0xdcba
jmp 0x2ee2c
movq %rax, %rbx
movq 0x78(%rsp), %rdi
cmpq %r14, %rdi
je 0x2ee2c
callq 0xa2b0
jmp 0x2ee2c
movq %rax, %rbx
movq %rbx, %rdi
callq 0xa510