// File: /workspace/github_cpp_makefile_star2_O2/menhits[P]phplus/src/PhplusStdLib.cpp
// Function: addToProgRunCmd(CppProgram*)
void addToProgRunCmd(CppProgram * prog)
{
	if (!prog->hasFunc("$runCmd"))
	{
		addToProgPpStr(prog);
		addToProgCStr(prog);
		addToProgConcatStr(prog);
		addToProgAsciiToStr(prog);
				
		string strType=prog->getTypeCode(String);
		
		prog->addFunc("$runCmd", {{strType, "cmd"}}, strType,
			strType+" result = "+prog->ppToCpp("$ppStr")+"(\"\");\n"
			"FILE* pipe = popen(cStr(cmd), \"r\");\n"
			"if (!pipe)\n"
			"	return result;\n"
			"while (!feof(pipe)) {\n"
			"	char c;\n"
			"	if ((c=getc(pipe)) != EOF)\n"
			"	{\n"
			"		result="+prog->ppToCpp("$concatStr")+"(result, "+prog->ppToCpp("$asciiToStr")+"(c));\n"
			"	}\n"
			"}\n"
			"pclose(pipe);\n"
			"return result;\n"
		);
	}
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
subq $0x270, %rsp            # imm = 0x270
movq %rdi, %rbx
leaq 0x3267e(%rip), %rsi     # 0x579ff
leaq 0x210(%rsp), %rdi
leaq 0x8(%rsp), %rdx
callq 0xa150
leaq 0x210(%rsp), %rsi
movq %rbx, %rdi
callq 0x17166
movl %eax, %ebp
leaq 0x210(%rsp), %rdi
callq 0xa558
testb %bpl, %bpl
jne 0x256b5
movq %rbx, %rdi
callq 0x23723
movq %rbx, %rdi
callq 0x23942
movq %rbx, %rdi
callq 0x24428
movq %rbx, %rdi
callq 0x24b97
leaq 0x5505e(%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
leaq 0x325ef(%rip), %rsi     # 0x579ff
leaq 0x250(%rsp), %rdi
leaq 0x7(%rsp), %rdx
callq 0xa150
leaq 0x325de(%rip), %rdx     # 0x57a07
leaq 0x210(%rsp), %rdi
leaq 0x8(%rsp), %rsi
callq 0x39cf0
leaq 0x38(%rsp), %rdi
leaq 0x210(%rsp), %rsi
pushq $0x1
popq %rdx
leaq 0x6(%rsp), %rcx
callq 0x39b20
leaq 0x1f0(%rsp), %rdi
leaq 0x8(%rsp), %rsi
callq 0xa3b0
leaq 0x3259d(%rip), %rdx     # 0x57a0b
leaq 0x110(%rsp), %rdi
leaq 0x8(%rsp), %rsi
callq 0x11fb8
leaq 0x31c09(%rip), %rsi     # 0x57090
leaq 0xd0(%rsp), %rdi
leaq 0x5(%rsp), %rdx
callq 0xa150
leaq 0xf0(%rsp), %rdi
leaq 0xd0(%rsp), %rdx
movq %rbx, %rsi
callq 0x184d4
leaq 0x130(%rsp), %rdi
leaq 0x110(%rsp), %rsi
leaq 0xf0(%rsp), %rdx
callq 0x1205e
leaq 0x32541(%rip), %rdx     # 0x57a16
leaq 0x150(%rsp), %rdi
leaq 0x130(%rsp), %rsi
callq 0xc882
leaq 0x3211d(%rip), %rsi     # 0x5760e
leaq 0x90(%rsp), %rdi
leaq 0x4(%rsp), %rdx
callq 0xa150
leaq 0xb0(%rsp), %rdi
leaq 0x90(%rsp), %rdx
movq %rbx, %rsi
callq 0x184d4
leaq 0x170(%rsp), %rdi
leaq 0x150(%rsp), %rsi
leaq 0xb0(%rsp), %rdx
callq 0x1205e
leaq 0x32564(%rip), %rdx     # 0x57aa3
leaq 0x190(%rsp), %rdi
leaq 0x170(%rsp), %rsi
callq 0xc882
leaq 0x3223b(%rip), %rsi     # 0x57796
leaq 0x50(%rsp), %rdi
leaq 0x3(%rsp), %rdx
callq 0xa150
leaq 0x70(%rsp), %rdi
leaq 0x50(%rsp), %rdx
movq %rbx, %rsi
callq 0x184d4
leaq 0x1b0(%rsp), %rdi
leaq 0x190(%rsp), %rsi
leaq 0x70(%rsp), %rdx
callq 0x1205e
leaq 0x32510(%rip), %rdx     # 0x57aad
leaq 0x1d0(%rsp), %rdi
leaq 0x1b0(%rsp), %rsi
callq 0xc882
leaq 0x250(%rsp), %rsi
leaq 0x38(%rsp), %rdx
leaq 0x1f0(%rsp), %rcx
leaq 0x1d0(%rsp), %r8
movq %rbx, %rdi
callq 0x17186
leaq 0x1d0(%rsp), %rdi
callq 0xa558
leaq 0x1b0(%rsp), %rdi
callq 0xa558
leaq 0x70(%rsp), %rdi
callq 0xa558
leaq 0x50(%rsp), %rdi
callq 0xa558
leaq 0x190(%rsp), %rdi
callq 0xa558
leaq 0x170(%rsp), %rdi
callq 0xa558
leaq 0xb0(%rsp), %rdi
callq 0xa558
leaq 0x90(%rsp), %rdi
callq 0xa558
leaq 0x150(%rsp), %rdi
callq 0xa558
leaq 0x130(%rsp), %rdi
callq 0xa558
leaq 0xf0(%rsp), %rdi
callq 0xa558
leaq 0xd0(%rsp), %rdi
callq 0xa558
leaq 0x110(%rsp), %rdi
callq 0xa558
leaq 0x1f0(%rsp), %rdi
callq 0xa558
leaq 0x38(%rsp), %rdi
callq 0x39b5a
leaq 0x210(%rsp), %rdi
callq 0x39b0a
leaq 0x250(%rsp), %rdi
callq 0xa558
leaq 0x8(%rsp), %rdi
callq 0xa558
addq $0x270, %rsp            # imm = 0x270
popq %rbx
popq %r14
popq %rbp
retq
movq %rax, %rbx
leaq 0x1d0(%rsp), %rdi
callq 0xa558
jmp 0x256d6
movq %rax, %rbx
leaq 0x1b0(%rsp), %rdi
callq 0xa558
jmp 0x256e8
movq %rax, %rbx
leaq 0x70(%rsp), %rdi
callq 0xa558
jmp 0x256f7
movq %rax, %rbx
leaq 0x50(%rsp), %rdi
callq 0xa558
jmp 0x25706
movq %rax, %rbx
leaq 0x190(%rsp), %rdi
callq 0xa558
leaq 0x170(%rsp), %rdi
callq 0xa558
leaq 0xb0(%rsp), %rdi
callq 0xa558
leaq 0x90(%rsp), %rdi
callq 0xa558
leaq 0x150(%rsp), %rdi
callq 0xa558
leaq 0x130(%rsp), %rdi
callq 0xa558
leaq 0xf0(%rsp), %rdi
callq 0xa558
leaq 0xd0(%rsp), %rdi
callq 0xa558
leaq 0x110(%rsp), %rdi
callq 0xa558
leaq 0x1f0(%rsp), %rdi
callq 0xa558
leaq 0x38(%rsp), %rdi
callq 0x39b5a
leaq 0x210(%rsp), %rdi
callq 0x39b0a
leaq 0x250(%rsp), %rdi
callq 0xa558
leaq 0x8(%rsp), %rdi
callq 0xa558
movq %rbx, %rdi
callq 0xa500
movq %rax, %rbx
jmp 0x25713
movq %rax, %rbx
jmp 0x25720
movq %rax, %rbx
jmp 0x2572d
movq %rax, %rbx
jmp 0x2573a
movq %rax, %rbx
jmp 0x25747
movq %rax, %rbx
jmp 0x25754
movq %rax, %rbx
jmp 0x25761
movq %rax, %rbx
jmp 0x2576e
movq %rax, %rbx
jmp 0x2577b
movq %rax, %rbx
jmp 0x25788
movq %rax, %rbx
jmp 0x25792
movq %rax, %rbx
jmp 0x2579f
movq %rax, %rbx
jmp 0x257ac
movq %rax, %rbx
leaq 0x30(%rsp), %rdi
callq 0xc984
jmp 0x257b6
movq %rax, %rbx
leaq 0x210(%rsp), %rdi
jmp 0x257b1
movq %rax, %rbx
jmp 0x257b6