// File: zeeev[P]DASVC/bamtools/src/api/internal/io/BamFtp_p.cpp
// Function: BamTools::Internal::BamFtp::SendCommand(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, bool)
bool BamFtp::SendCommand(const string& command, bool waitForReply) {

    // failure if not connected
    if ( !m_commandSocket->IsConnected() ) {
        SetErrorString("BamFtp::SendCommand", "command socket not connected");
        return false;
    }

    // write command to 'command socket'
    if ( WriteCommandSocket(command.c_str(), command.length()) == -1 ) {
        SetErrorString("BamFtp::SendCommand", "error writing to socket");
        // get actual error from command socket??
        return false;
    }

    // if we sent a command that receives a response
    if ( waitForReply )
        return ReceiveReply();

    // return success
    return true;
}

// Assembly:
subq $0x108, %rsp            # imm = 0x108
movb %dl, %al
movq %rdi, 0xf8(%rsp)
movq %rsi, 0xf0(%rsp)
andb $0x1, %al
movb %al, 0xef(%rsp)
movq 0xf8(%rsp), %rax
movq %rax, 0x30(%rsp)
movq 0x30(%rax), %rdi
callq 0x75cd0
testb $0x1, %al
jne 0xc7c6c
leaq 0xc7(%rsp), %rdi
movq %rdi, 0x28(%rsp)
callq 0x7b5f0
movq 0x28(%rsp), %rdx
leaq 0x24197(%rip), %rsi     # 0xebce5
leaq 0xc8(%rsp), %rdi
callq 0x78e70
jmp 0xc7b5d
leaq 0x8f(%rsp), %rdi
movq %rdi, 0x20(%rsp)
callq 0x7b5f0
movq 0x20(%rsp), %rdx
leaq 0x2411d(%rip), %rsi     # 0xebc98
leaq 0x90(%rsp), %rdi
callq 0x78e70
jmp 0xc7b8a
movq 0x30(%rsp), %rdi
leaq 0xc8(%rsp), %rsi
leaq 0x90(%rsp), %rdx
callq 0x7ab60
jmp 0xc7ba6
leaq 0x90(%rsp), %rdi
callq 0x7cce8
jmp 0xc7bb5
leaq 0x8f(%rsp), %rdi
callq 0x76f80
leaq 0xc8(%rsp), %rdi
callq 0x7cce8
jmp 0xc7bd1
leaq 0xc7(%rsp), %rdi
callq 0x76f80
movb $0x0, 0x107(%rsp)
jmp 0xc7ddc
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0xb8(%rsp)
movl %eax, 0xb4(%rsp)
jmp 0xc7c5a
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0xb8(%rsp)
movl %eax, 0xb4(%rsp)
jmp 0xc7c3c
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0xb8(%rsp)
movl %eax, 0xb4(%rsp)
leaq 0x90(%rsp), %rdi
callq 0x7cce8
jmp 0xc7c3a
jmp 0xc7c3c
leaq 0x8f(%rsp), %rdi
callq 0x76f80
leaq 0xc8(%rsp), %rdi
callq 0x7cce8
jmp 0xc7c58
jmp 0xc7c5a
leaq 0xc7(%rsp), %rdi
callq 0x76f80
jmp 0xc7ded
movq 0xf0(%rsp), %rdi
callq 0x73020
movq %rax, 0x18(%rsp)
movq 0xf0(%rsp), %rdi
callq 0x79c80
movq 0x30(%rsp), %rdi
movq 0x18(%rsp), %rsi
movl %eax, %edx
callq 0x74940
cmpq $-0x1, %rax
jne 0xc7db5
leaq 0x67(%rsp), %rdi
movq %rdi, 0x10(%rsp)
callq 0x7b5f0
movq 0x10(%rsp), %rdx
leaq 0x24024(%rip), %rsi     # 0xebce5
leaq 0x68(%rsp), %rdi
callq 0x78e70
jmp 0xc7ccd
leaq 0x3f(%rsp), %rdi
movq %rdi, 0x8(%rsp)
callq 0x7b5f0
movq 0x8(%rsp), %rdx
leaq 0x24011(%rip), %rsi     # 0xebcf9
leaq 0x40(%rsp), %rdi
callq 0x78e70
jmp 0xc7cf4
movq 0x30(%rsp), %rdi
leaq 0x68(%rsp), %rsi
leaq 0x40(%rsp), %rdx
callq 0x7ab60
jmp 0xc7d0a
leaq 0x40(%rsp), %rdi
callq 0x7cce8
jmp 0xc7d16
leaq 0x3f(%rsp), %rdi
callq 0x76f80
leaq 0x68(%rsp), %rdi
callq 0x7cce8
jmp 0xc7d2c
leaq 0x67(%rsp), %rdi
callq 0x76f80
movb $0x0, 0x107(%rsp)
jmp 0xc7ddc
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0xb8(%rsp)
movl %eax, 0xb4(%rsp)
jmp 0xc7da9
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0xb8(%rsp)
movl %eax, 0xb4(%rsp)
jmp 0xc7d91
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0xb8(%rsp)
movl %eax, 0xb4(%rsp)
leaq 0x40(%rsp), %rdi
callq 0x7cce8
jmp 0xc7d8f
jmp 0xc7d91
leaq 0x3f(%rsp), %rdi
callq 0x76f80
leaq 0x68(%rsp), %rdi
callq 0x7cce8
jmp 0xc7da7
jmp 0xc7da9
leaq 0x67(%rsp), %rdi
callq 0x76f80
jmp 0xc7ded
testb $0x1, 0xef(%rsp)
je 0xc7dd4
movq 0x30(%rsp), %rdi
callq 0x77950
andb $0x1, %al
movb %al, 0x107(%rsp)
jmp 0xc7ddc
movb $0x1, 0x107(%rsp)
movb 0x107(%rsp), %al
andb $0x1, %al
addq $0x108, %rsp            # imm = 0x108
retq
movq 0xb8(%rsp), %rdi
callq 0x7b550
movq %rax, %rdi
callq 0x88ef0
nopw %cs:(%rax,%rax)