// File: npazosmendez[P]branchsearch/branchsearch.cpp
// Function: run_command(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>>*, bool)
int run_command(const string& command, vector<string>* out_lines=nullptr, bool show_failure=true){
    vector<string> _out_lines;
    char buff[MAX_LINE_LEN];
    FILE *f = popen(command.c_str(), "r");
    while (!feof(f)) if (fgets(buff, sizeof(buff), f) != NULL)
        _out_lines.push_back(buff);
    int status = WEXITSTATUS(pclose(f));
    if(status and show_failure){
        erase();
        for(auto &l : _out_lines) addstr(l.c_str());
        addstr("\n\nPress any key to continue.");
        while(!kbhit());
        getch();
    }
    if(out_lines) *out_lines = _out_lines;
    return status;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x2c0, %rsp            # imm = 0x2C0
movb %dl, %al
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
andb $0x1, %al
movb %al, -0x11(%rbp)
leaq -0x30(%rbp), %rdi
callq 0x72e0
movq -0x8(%rbp), %rdi
callq 0x51c0
movq %rax, %rdi
leaq 0x317e7(%rip), %rsi     # 0x371cd
callq 0x5110
movq %rax, -0x298(%rbp)
jmp 0x59f4
movq -0x298(%rbp), %rax
movq %rax, -0x238(%rbp)
movq -0x238(%rbp), %rdi
callq 0x56a0
cmpl $0x0, %eax
setne %al
xorb $-0x1, %al
testb $0x1, %al
jne 0x5a1f
jmp 0x5b0b
movq -0x238(%rbp), %rdx
leaq -0x230(%rbp), %rdi
movl $0x1f4, %esi            # imm = 0x1F4
callq 0x56c0
movq %rax, -0x2a0(%rbp)
jmp 0x5a40
movq -0x2a0(%rbp), %rax
cmpq $0x0, %rax
je 0x5b06
leaq -0x269(%rbp), %rdi
movq %rdi, -0x2a8(%rbp)
callq 0x5790
movq -0x2a8(%rbp), %rdx
leaq -0x268(%rbp), %rdi
leaq -0x230(%rbp), %rsi
callq 0x7330
jmp 0x5a80
leaq -0x30(%rbp), %rdi
leaq -0x268(%rbp), %rsi
callq 0x7300
jmp 0x5a92
leaq -0x268(%rbp), %rdi
callq 0x52c0
leaq -0x269(%rbp), %rdi
callq 0x54b0
jmp 0x5b06
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x240(%rbp)
movl %eax, -0x244(%rbp)
jmp 0x5c82
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x240(%rbp)
movl %eax, -0x244(%rbp)
jmp 0x5af5
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x240(%rbp)
movl %eax, -0x244(%rbp)
leaq -0x268(%rbp), %rdi
callq 0x52c0
leaq -0x269(%rbp), %rdi
callq 0x54b0
jmp 0x5c82
jmp 0x5a02
movq -0x238(%rbp), %rdi
callq 0x5640
movl %eax, -0x2ac(%rbp)
jmp 0x5b1f
movl -0x2ac(%rbp), %eax
andl $0xff00, %eax           # imm = 0xFF00
sarl $0x8, %eax
movl %eax, -0x270(%rbp)
cmpl $0x0, -0x270(%rbp)
je 0x5c46
testb $0x1, -0x11(%rbp)
je 0x5c46
callq 0x5490
jmp 0x5b51
leaq -0x30(%rbp), %rax
movq %rax, -0x278(%rbp)
movq -0x278(%rbp), %rdi
callq 0x73e0
movq %rax, -0x280(%rbp)
movq -0x278(%rbp), %rdi
callq 0x7410
movq %rax, -0x288(%rbp)
leaq -0x280(%rbp), %rdi
leaq -0x288(%rbp), %rsi
callq 0x7440
testb $0x1, %al
jne 0x5b9b
jmp 0x5bf1
leaq -0x280(%rbp), %rdi
callq 0x7480
movq %rax, -0x290(%rbp)
movq 0x4c3f3(%rip), %rax     # 0x51fa8
movq (%rax), %rax
movq %rax, -0x2b8(%rbp)
movq -0x290(%rbp), %rdi
callq 0x51c0
movq -0x2b8(%rbp), %rdi
movq %rax, %rsi
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x5140
jmp 0x5be1
jmp 0x5be3
leaq -0x280(%rbp), %rdi
callq 0x74a0
jmp 0x5b82
movq 0x4c3b0(%rip), %rax     # 0x51fa8
movq (%rax), %rdi
leaq 0x31586(%rip), %rsi     # 0x37188
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x5140
jmp 0x5c0e
jmp 0x5c10
callq 0x5960
movl %eax, -0x2bc(%rbp)
jmp 0x5c1d
movl -0x2bc(%rbp), %eax
cmpl $0x0, %eax
setne %al
xorb $-0x1, %al
testb $0x1, %al
jne 0x5c31
jmp 0x5c33
jmp 0x5c10
movq 0x4c36e(%rip), %rax     # 0x51fa8
movq (%rax), %rdi
callq 0x5180
jmp 0x5c44
jmp 0x5c46
cmpq $0x0, -0x10(%rbp)
je 0x5c5e
movq -0x10(%rbp), %rdi
leaq -0x30(%rbp), %rsi
callq 0x74c0
jmp 0x5c5c
jmp 0x5c5e
movl -0x270(%rbp), %eax
movl %eax, -0x2c0(%rbp)
leaq -0x30(%rbp), %rdi
callq 0x7710
movl -0x2c0(%rbp), %eax
addq $0x2c0, %rsp            # imm = 0x2C0
popq %rbp
retq
leaq -0x30(%rbp), %rdi
callq 0x7710
movq -0x240(%rbp), %rdi
callq 0x5780
nopw (%rax,%rax)