// File: menhits[P]phplus/src/msclStringFuncs.cpp
// Function: runCmd(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, bool)
string runCmd(string cmd, bool printOutput) // if print output is false, nothing will be printed unil the entire command is done
{
    std::string result = "";
    FILE* pipe = popen(cmd.c_str(), "r");
    if (!pipe) throw std::runtime_error("popen() failed in getOutputFromCmd");
    try {
        while (!feof(pipe)) {
			char c;
            if ((c=getc(pipe)) != EOF)
			{
                result += c;
                
                if (printOutput)
				{
					cout << c;
					cout.flush();
				}
			}
        }
    } catch (...) {
        pclose(pipe);
        throw;
    }
    pclose(pipe);
    return result;
}

// Assembly:
subq $0x78, %rsp
movq %rsi, 0x20(%rsp)
movq %rdi, 0x30(%rsp)
movb %dl, %al
movq %rdi, %rcx
movq %rcx, 0x28(%rsp)
movq %rdi, 0x70(%rsp)
movq %rsi, 0x68(%rsp)
andb $0x1, %al
movb %al, 0x67(%rsp)
movb $0x0, 0x66(%rsp)
leaq 0x65(%rsp), %rdi
movq %rdi, 0x38(%rsp)
callq 0xb690
movq 0x30(%rsp), %rdi
movq 0x38(%rsp), %rdx
leaq 0x24582(%rip), %rsi     # 0xd1a1f
callq 0xb4c0
jmp 0xad4a4
leaq 0x65(%rsp), %rdi
callq 0xb3f0
movq 0x20(%rsp), %rdi
callq 0xb190
movq %rax, %rdi
leaq 0x248fc(%rip), %rsi     # 0xd1dbe
callq 0xb130
movq %rax, 0x18(%rsp)
jmp 0xad4ce
movq 0x18(%rsp), %rax
movq %rax, 0x48(%rsp)
cmpq $0x0, 0x48(%rsp)
jne 0xad571
movl $0x10, %edi
callq 0xb1f0
movq %rax, %rdi
movq %rdi, %rax
movq %rax, 0x10(%rsp)
leaq 0x29601(%rip), %rsi     # 0xd6b01
callq 0xb170
jmp 0xad507
movq 0x10(%rsp), %rdi
movq 0x6aadd(%rip), %rsi     # 0x117ff0
movq 0x6aa7e(%rip), %rdx     # 0x117f98
callq 0xb640
jmp 0xad67c
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x58(%rsp)
movl %eax, 0x54(%rsp)
leaq 0x65(%rsp), %rdi
callq 0xb3f0
jmp 0xad66a
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x58(%rsp)
movl %eax, 0x54(%rsp)
jmp 0xad660
movq 0x10(%rsp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x58(%rsp)
movl %eax, 0x54(%rsp)
callq 0xb2d0
jmp 0xad660
jmp 0xad573
movq 0x48(%rsp), %rdi
callq 0xb5b0
cmpl $0x0, %eax
setne %al
xorb $-0x1, %al
testb $0x1, %al
jne 0xad58e
jmp 0xad61b
movq 0x48(%rsp), %rdi
callq 0xb120
movl %eax, 0xc(%rsp)
jmp 0xad59e
movl 0xc(%rsp), %eax
movb %al, 0x47(%rsp)
movsbl %al, %eax
cmpl $-0x1, %eax
je 0xad616
movq 0x30(%rsp), %rdi
movsbl 0x47(%rsp), %esi
callq 0xb260
jmp 0xad5bf
testb $0x1, 0x67(%rsp)
je 0xad614
movsbl 0x47(%rsp), %esi
movq 0x6a9de(%rip), %rdi     # 0x117fb0
callq 0xb410
jmp 0xad5d9
movq 0x6a9d0(%rip), %rdi     # 0x117fb0
callq 0xb280
jmp 0xad5e7
jmp 0xad614
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x58(%rsp)
movl %eax, 0x54(%rsp)
movq 0x58(%rsp), %rdi
callq 0xb180
movq 0x48(%rsp), %rdi
callq 0xb540
jmp 0xad60d
callq 0xb560
jmp 0xad67c
jmp 0xad616
jmp 0xad573
jmp 0xad634
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x58(%rsp)
movl %eax, 0x54(%rsp)
callq 0xb5f0
jmp 0xad632
jmp 0xad660
movq 0x48(%rsp), %rdi
callq 0xb540
jmp 0xad640
movb $0x1, 0x66(%rsp)
testb $0x1, 0x66(%rsp)
jne 0xad656
movq 0x30(%rsp), %rdi
callq 0xb6e8
movq 0x28(%rsp), %rax
addq $0x78, %rsp
retq
movq 0x30(%rsp), %rdi
callq 0xb6e8
movq 0x58(%rsp), %rdi
callq 0xb680
movq %rax, %rdi
callq 0xffe0
nopl (%rax)