// File: /workspace/github_cpp_makefile_star2_O2/menhits[P]phplus/src/PhplusStdLib.cpp
// Function: addToProgDoubleToStr(CppProgram*)
void addToProgDoubleToStr(CppProgram * prog)
{
	if (!prog->hasFunc("$doubleToStr"))
	{
		addToProgIntToStr(prog);
		addToProgConcatStr(prog);
		addToProgPpStr(prog);
		
		string intToStr=prog->ppToCpp("$intToStr");
		string concat=prog->ppToCpp("$concatStr");
		string ppStr=prog->ppToCpp("$ppStr");
		
		prog->addFunc("$doubleToStr", {{"double", "in"}}, prog->getTypeCode(String),
			
			"long long b = (in - (long long)in) * 10000000000 * (in>=0 ? 1 : -1);\n"
			"if (b % 10 == 9)\n\tb += 1;\n"
			"while (b>0 && !(b % 10))\n\tb /= 10;\n"
			"return "+concat+"("+concat+"("+intToStr+"((int)in), "+ppStr+"(\".\")), "+intToStr+"(b));\n"
		);
	}
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
subq $0x250, %rsp            # imm = 0x250
movq %rdi, %rbx
leaq 0x3303d(%rip), %rsi     # 0x576e3
leaq 0x8(%rsp), %rdi
leaq 0x78(%rsp), %rdx
callq 0xa150
leaq 0x8(%rsp), %rsi
movq %rbx, %rdi
callq 0x17166
movl %eax, %ebp
leaq 0x8(%rsp), %rdi
callq 0xa558
testb %bpl, %bpl
jne 0x24a16
movq %rbx, %rdi
callq 0x23e02
movq %rbx, %rdi
callq 0x24428
movq %rbx, %rdi
callq 0x23723
leaq 0x32af3(%rip), %rsi     # 0x571e9
leaq 0x8(%rsp), %rdi
leaq 0x58(%rsp), %rdx
callq 0xa150
leaq 0x78(%rsp), %rdi
leaq 0x8(%rsp), %rdx
movq %rbx, %rsi
callq 0x184d4
leaq 0x8(%rsp), %rdi
callq 0xa558
leaq 0x32ee6(%rip), %rsi     # 0x5760e
leaq 0x8(%rsp), %rdi
leaq 0xd0(%rsp), %rdx
callq 0xa150
leaq 0x58(%rsp), %rdi
leaq 0x8(%rsp), %rdx
movq %rbx, %rsi
callq 0x184d4
leaq 0x8(%rsp), %rdi
callq 0xa558
leaq 0x32933(%rip), %rsi     # 0x57090
leaq 0x8(%rsp), %rdi
leaq 0xb0(%rsp), %rdx
callq 0xa150
leaq 0xd0(%rsp), %rdi
leaq 0x8(%rsp), %rdx
movq %rbx, %rsi
callq 0x184d4
leaq 0x8(%rsp), %rdi
callq 0xa558
leaq 0x32f4e(%rip), %rsi     # 0x576e3
leaq 0xb0(%rsp), %rdi
leaq 0x7(%rsp), %rdx
callq 0xa150
leaq 0x3042a(%rip), %rsi     # 0x54bd8
leaq 0x306c8(%rip), %rdx     # 0x54e7d
leaq 0x8(%rsp), %rdi
callq 0x39c74
leaq 0x98(%rsp), %rdi
leaq 0x8(%rsp), %rsi
pushq $0x1
popq %rdx
leaq 0x6(%rsp), %rcx
callq 0x39b20
leaq 0x55c60(%rip), %rsi     # 0x7a440
leaq 0x48(%rsp), %r14
movq %r14, %rdi
callq 0x12c0a
leaq 0x230(%rsp), %rdi
movq %rbx, %rsi
movq %r14, %rdx
callq 0x15e88
leaq 0x32ee9(%rip), %rsi     # 0x576f0
leaq 0xf0(%rsp), %rdi
leaq 0x58(%rsp), %rdx
callq 0xc8a1
leaq 0x35180(%rip), %rdx     # 0x599a0
leaq 0x110(%rsp), %rdi
leaq 0xf0(%rsp), %rsi
callq 0xc882
leaq 0x130(%rsp), %rdi
leaq 0x110(%rsp), %rsi
leaq 0x58(%rsp), %rdx
callq 0x184b5
leaq 0x3514a(%rip), %rdx     # 0x599a0
leaq 0x150(%rsp), %rdi
leaq 0x130(%rsp), %rsi
callq 0xc882
leaq 0x170(%rsp), %rdi
leaq 0x150(%rsp), %rsi
leaq 0x78(%rsp), %rdx
callq 0x184b5
leaq 0x32eee(%rip), %rdx     # 0x5777a
leaq 0x190(%rsp), %rdi
leaq 0x170(%rsp), %rsi
callq 0xc882
leaq 0x1b0(%rsp), %rdi
leaq 0x190(%rsp), %rsi
leaq 0xd0(%rsp), %rdx
callq 0x184b5
leaq 0x32ec1(%rip), %rdx     # 0x57786
leaq 0x1d0(%rsp), %rdi
leaq 0x1b0(%rsp), %rsi
callq 0xc882
leaq 0x1f0(%rsp), %rdi
leaq 0x1d0(%rsp), %rsi
leaq 0x78(%rsp), %rdx
callq 0x184b5
leaq 0x32e94(%rip), %rdx     # 0x5778f
leaq 0x210(%rsp), %rdi
leaq 0x1f0(%rsp), %rsi
callq 0xc882
leaq 0xb0(%rsp), %rsi
leaq 0x98(%rsp), %rdx
leaq 0x230(%rsp), %rcx
leaq 0x210(%rsp), %r8
movq %rbx, %rdi
callq 0x17186
leaq 0x210(%rsp), %rdi
callq 0xa558
leaq 0x1f0(%rsp), %rdi
callq 0xa558
leaq 0x1d0(%rsp), %rdi
callq 0xa558
leaq 0x1b0(%rsp), %rdi
callq 0xa558
leaq 0x190(%rsp), %rdi
callq 0xa558
leaq 0x170(%rsp), %rdi
callq 0xa558
leaq 0x150(%rsp), %rdi
callq 0xa558
leaq 0x130(%rsp), %rdi
callq 0xa558
leaq 0x110(%rsp), %rdi
callq 0xa558
leaq 0xf0(%rsp), %rdi
callq 0xa558
leaq 0x230(%rsp), %rdi
callq 0xa558
leaq 0x50(%rsp), %rdi
callq 0xc984
leaq 0x98(%rsp), %rdi
callq 0x39b5a
leaq 0x8(%rsp), %rdi
callq 0x39b0a
leaq 0xb0(%rsp), %rdi
callq 0xa558
leaq 0xd0(%rsp), %rdi
callq 0xa558
leaq 0x58(%rsp), %rdi
callq 0xa558
leaq 0x78(%rsp), %rdi
callq 0xa558
addq $0x250, %rsp            # imm = 0x250
popq %rbx
popq %r14
popq %rbp
retq
movq %rax, %rbx
leaq 0x210(%rsp), %rdi
callq 0xa558
jmp 0x24a37
movq %rax, %rbx
leaq 0x1f0(%rsp), %rdi
callq 0xa558
jmp 0x24a49
movq %rax, %rbx
leaq 0x1d0(%rsp), %rdi
callq 0xa558
jmp 0x24a5b
movq %rax, %rbx
leaq 0x1b0(%rsp), %rdi
callq 0xa558
jmp 0x24a6d
movq %rax, %rbx
leaq 0x190(%rsp), %rdi
callq 0xa558
leaq 0x170(%rsp), %rdi
callq 0xa558
leaq 0x150(%rsp), %rdi
callq 0xa558
leaq 0x130(%rsp), %rdi
callq 0xa558
leaq 0x110(%rsp), %rdi
callq 0xa558
leaq 0xf0(%rsp), %rdi
callq 0xa558
leaq 0x230(%rsp), %rdi
callq 0xa558
leaq 0x50(%rsp), %rdi
callq 0xc984
leaq 0x98(%rsp), %rdi
callq 0x39b5a
leaq 0x8(%rsp), %rdi
callq 0x39b0a
leaq 0xb0(%rsp), %rdi
callq 0xa558
leaq 0xd0(%rsp), %rdi
callq 0xa558
leaq 0x58(%rsp), %rdi
callq 0xa558
leaq 0x78(%rsp), %rdi
callq 0xa558
movq %rbx, %rdi
callq 0xa500
movq %rax, %rbx
jmp 0x24a7a
movq %rax, %rbx
jmp 0x24a87
movq %rax, %rbx
jmp 0x24a94
movq %rax, %rbx
jmp 0x24aa1
movq %rax, %rbx
jmp 0x24aae
movq %rax, %rbx
jmp 0x24abb
movq %rax, %rbx
jmp 0x24ac8
movq %rax, %rbx
jmp 0x24adf
movq %rax, %rbx
jmp 0x24ae9
movq %rax, %rbx
jmp 0x24af6
movq %rax, %rbx
leaq 0x8(%rsp), %rdi
jmp 0x24afe
movq %rax, %rbx
jmp 0x24b03
movq %rax, %rbx
leaq 0x8(%rsp), %rdi
jmp 0x24b08
movq %rax, %rbx
jmp 0x24b0d
jmp 0x24b88
jmp 0x24b92
movq %rax, %rbx
leaq 0x8(%rsp), %rdi
jmp 0x24b12
movq %rax, %rbx
jmp 0x24b17