// File: /workspace/github_cpp_makefile_star2_O2/menhits[P]phplus/src/PhplusStdLib.cpp
// Function: addToProgGetInputLine(CppProgram*)
void addToProgGetInputLine(CppProgram * prog)
{
	if (!prog->hasFunc("$getInputLine"))
	{
		string strType=prog->getTypeCode(String);
		
		addToProgCStr(prog);
		
		prog->addFunc("$getInputLine", {{strType, "prompt"}}, strType,
			"fputs("+prog->ppToCpp("$cStr")+"(prompt), stdout);\n"
			"fflush(stdout);\n"
			"size_t bufferSize = 4096;\n"
			"char buffer[bufferSize];\n"
			"if (fgets(buffer, bufferSize, stdin))\n"
			"{\n"
			"	int size = strlen(buffer);\n"
			"	while (size > 0 && buffer[size - 1] == '\\n')\n"
			"		size-=1;\n"
			"	unsigned char * data = (unsigned char *)malloc(size);\n"
			"	memcpy(data, buffer, size);\n"
			"	return "+strType+"(size, data);\n"
			"}\nelse\n{\n"
			"	return "+strType+"(0, NULL);\n"
			"}"
		);
	}
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
subq $0x1d0, %rsp            # imm = 0x1D0
movq %rdi, %rbx
leaq 0x32a2a(%rip), %rsi     # 0x577f5
leaq 0x170(%rsp), %rdi
leaq 0x8(%rsp), %rdx
callq 0xa150
leaq 0x170(%rsp), %rsi
movq %rbx, %rdi
callq 0x17166
movl %eax, %ebp
leaq 0x170(%rsp), %rdi
callq 0xa558
testb %bpl, %bpl
jne 0x25024
leaq 0x55634(%rip), %rsi     # 0x7a440
leaq 0x28(%rsp), %r14
movq %r14, %rdi
callq 0x12c0a
leaq 0x8(%rsp), %rdi
movq %rbx, %rsi
movq %r14, %rdx
callq 0x15e88
leaq 0x30(%rsp), %rdi
callq 0xc984
movq %rbx, %rdi
callq 0x23942
leaq 0x329b3(%rip), %rsi     # 0x577f5
leaq 0x1b0(%rsp), %rdi
leaq 0x7(%rsp), %rdx
callq 0xa150
leaq 0x329a8(%rip), %rdx     # 0x57803
leaq 0x170(%rsp), %rdi
leaq 0x8(%rsp), %rsi
callq 0x39cb4
leaq 0x38(%rsp), %rdi
leaq 0x170(%rsp), %rsi
pushq $0x1
popq %rdx
leaq 0x6(%rsp), %rcx
callq 0x39b20
leaq 0x150(%rsp), %rdi
leaq 0x8(%rsp), %rsi
callq 0xa3b0
leaq 0x32250(%rip), %rsi     # 0x570f0
leaq 0x50(%rsp), %rdi
leaq 0x5(%rsp), %rdx
callq 0xa150
leaq 0x70(%rsp), %rdi
leaq 0x50(%rsp), %rdx
movq %rbx, %rsi
callq 0x184d4
leaq 0x32942(%rip), %rsi     # 0x5780a
leaq 0x90(%rsp), %rdi
leaq 0x70(%rsp), %rdx
callq 0x11ff8
leaq 0x32930(%rip), %rdx     # 0x57811
leaq 0xb0(%rsp), %rdi
leaq 0x90(%rsp), %rsi
callq 0xc882
leaq 0xd0(%rsp), %rdi
leaq 0xb0(%rsp), %rsi
leaq 0x8(%rsp), %rdx
callq 0x184b5
leaq 0x32a2a(%rip), %rdx     # 0x57941
leaq 0xf0(%rsp), %rdi
leaq 0xd0(%rsp), %rsi
callq 0xc882
leaq 0x110(%rsp), %rdi
leaq 0xf0(%rsp), %rsi
leaq 0x8(%rsp), %rdx
callq 0x184b5
leaq 0x32a14(%rip), %rdx     # 0x57961
leaq 0x130(%rsp), %rdi
leaq 0x110(%rsp), %rsi
callq 0xc882
leaq 0x1b0(%rsp), %rsi
leaq 0x38(%rsp), %rdx
leaq 0x150(%rsp), %rcx
leaq 0x130(%rsp), %r8
movq %rbx, %rdi
callq 0x17186
leaq 0x130(%rsp), %rdi
callq 0xa558
leaq 0x110(%rsp), %rdi
callq 0xa558
leaq 0xf0(%rsp), %rdi
callq 0xa558
leaq 0xd0(%rsp), %rdi
callq 0xa558
leaq 0xb0(%rsp), %rdi
callq 0xa558
leaq 0x90(%rsp), %rdi
callq 0xa558
leaq 0x70(%rsp), %rdi
callq 0xa558
leaq 0x50(%rsp), %rdi
callq 0xa558
leaq 0x150(%rsp), %rdi
callq 0xa558
leaq 0x38(%rsp), %rdi
callq 0x39b5a
leaq 0x170(%rsp), %rdi
callq 0x39b0a
leaq 0x1b0(%rsp), %rdi
callq 0xa558
leaq 0x8(%rsp), %rdi
callq 0xa558
addq $0x1d0, %rsp            # imm = 0x1D0
popq %rbx
popq %r14
popq %rbp
retq
movq %rax, %rbx
leaq 0x130(%rsp), %rdi
callq 0xa558
jmp 0x25045
movq %rax, %rbx
leaq 0x110(%rsp), %rdi
callq 0xa558
jmp 0x25057
movq %rax, %rbx
leaq 0xf0(%rsp), %rdi
callq 0xa558
jmp 0x25069
movq %rax, %rbx
leaq 0xd0(%rsp), %rdi
callq 0xa558
jmp 0x2507b
movq %rax, %rbx
leaq 0xb0(%rsp), %rdi
callq 0xa558
leaq 0x90(%rsp), %rdi
callq 0xa558
leaq 0x70(%rsp), %rdi
callq 0xa558
leaq 0x50(%rsp), %rdi
callq 0xa558
leaq 0x150(%rsp), %rdi
callq 0xa558
leaq 0x38(%rsp), %rdi
callq 0x39b5a
leaq 0x170(%rsp), %rdi
callq 0x39b0a
leaq 0x1b0(%rsp), %rdi
callq 0xa558
leaq 0x8(%rsp), %rdi
callq 0xa558
movq %rbx, %rdi
callq 0xa500
movq %rax, %rbx
jmp 0x25088
movq %rax, %rbx
jmp 0x25095
movq %rax, %rbx
jmp 0x2509f
movq %rax, %rbx
jmp 0x250a9
movq %rax, %rbx
jmp 0x250b6
movq %rax, %rbx
jmp 0x250c0
movq %rax, %rbx
jmp 0x250cd
jmp 0x25111
movq %rax, %rbx
jmp 0x250da
movq %rax, %rbx
leaq 0x30(%rsp), %rdi
callq 0xc984
jmp 0x250e4
movq %rax, %rbx
leaq 0x170(%rsp), %rdi
jmp 0x250df
movq %rax, %rbx
jmp 0x250e4