// File: /workspace/github_cpp_makefile_star2_O2/lianxings[P]ftp_benchmark/ftp_benchmark.cc
// Function: local2ftp_dispatcher(ftpInfo*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>)
void local2ftp_dispatcher(ftpInfo * pFtp, string localPath, string ftpPath) 
{
    // normalize directory path format
    normalize_dir_format(localPath, ftpPath);

    // connect to ftp server and login
    ftplib * ftpClient = new ftplib();
    int ret = connect_and_login_ftp (ftpClient, pFtp, 0);
    if (ret < 0) {
        if (ret == -2)
            fprintf(stderr, "login ftp server %s failed.\n", pFtp->ftpServer);
        goto error_out;
    }
    
    // add task to queue
    local2ftp_dispatcher_core(ftpClient, localPath, ftpPath);

error_out:
    ftpClient->Quit();
    exitFlag = 1;
    tasksExecuteCV.notify_all();    
    delete ftpClient;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x2a8, %rsp            # imm = 0x2A8
movq %rdx, %rbx
movq %rsi, %r15
movq %rdi, %r14
movq %rsi, %rdi
movq %rdx, %rsi
callq 0xbe13
pushq $0x8
popq %rdi
callq 0x43e0
movq %rax, %r12
movq %rax, %rdi
callq 0xc110
movq %r12, %rdi
movq %r14, %rsi
callq 0x54b6
testl %eax, %eax
js 0x5b5b
leaq 0x88(%rsp), %rdi
movq %r15, %rsi
callq 0x4510
leaq 0x68(%rsp), %rdi
movq %rbx, %rsi
callq 0x4510
leaq 0x180(%rsp), %rdi
leaq 0x88(%rsp), %rsi
callq 0x4510
leaq 0x180(%rsp), %rdi
callq 0xbc80
movl %eax, %ebx
leaq 0x180(%rsp), %rdi
callq 0x4170
testl %ebx, %ebx
je 0x5b84
leaq 0x88(%rsp), %rdi
leaq 0x68(%rsp), %rsi
callq 0xbe13
movq 0x68(%rsp), %rsi
movq %r12, %rdi
callq 0xdace
testl %eax, %eax
je 0x5b9f
leaq 0x130(%rsp), %rdi
callq 0xa44a
leaq 0xb8(%rsp), %rax
movq %rax, -0x10(%rax)
andq $0x0, -0x8(%rax)
xorl %ecx, %ecx
movb %cl, (%rax)
leaq 0xd8(%rsp), %rax
movq %rax, -0x10(%rax)
andq $0x0, -0x8(%rax)
movb %cl, (%rax)
leaq 0xa8(%rsp), %rdi
leaq 0x88(%rsp), %rsi
callq 0x4200
leaq 0xc8(%rsp), %rdi
leaq 0x68(%rsp), %rsi
callq 0x4200
leaq 0x130(%rsp), %rdi
leaq 0xa8(%rsp), %rsi
callq 0xa6b2
movq %r12, 0x8(%rsp)
leaq 0xa8(%rsp), %rbx
leaq 0x110(%rsp), %rbp
leaq 0xe8(%rsp), %r14
leaq 0x1a0(%rsp), %r12
leaq 0x1c8(%rsp), %r15
leaq 0x218(%rsp), %r13
movq 0x160(%rsp), %rax
cmpq 0x140(%rsp), %rax
je 0x5bfd
leaq 0x130(%rsp), %rdi
callq 0xa7ca
xorl %ecx, %ecx
testl %eax, %eax
cmovlel %ecx, %eax
movq %rax, 0x60(%rsp)
cmpl 0x60(%rsp), %ecx
je 0x57d6
movl %ecx, 0x4(%rsp)
movq 0x140(%rsp), %rsi
movq %rbx, %rdi
callq 0xa466
leaq 0x130(%rsp), %rdi
callq 0xa962
leaq 0x30(%rsp), %rdi
movq %rbx, %rsi
callq 0x4510
movq 0x8(%rsp), %rbx
leaq 0x10(%rsp), %rdi
leaq 0xc8(%rsp), %rsi
callq 0x4510
movq %rbp, %rdi
leaq 0x30(%rsp), %rsi
callq 0xbf5d
leaq 0x10(%rsp), %rdi
movq %rbp, %rsi
callq 0x4730
movq 0x18(%rsp), %rsi
decq %rsi
leaq 0x10(%rsp), %rdi
callq 0x4710
cmpb $0x2f, (%rax)
je 0x588e
leaq 0x10(%rsp), %rdi
pushq $0x2f
popq %rsi
callq 0x4310
movq 0x10(%rsp), %rsi
movq %rbx, %rdi
callq 0xdace
testl %eax, %eax
jne 0x58b4
movq 0x10(%rsp), %rsi
movq %rbx, %rdi
callq 0xda6a
testl %eax, %eax
je 0x5bbe
movq 0x30(%rsp), %rdi
callq 0x4580
movq %rax, %rbp
testq %rax, %rax
je 0x5b3c
movq %rbp, %rdi
callq 0x4590
movq %rax, %rbx
testq %rax, %rax
je 0x5af1
movq %rbx, %rax
cmpb $0x2e, 0x13(%rbx)
jne 0x58fa
movzbl 0x14(%rax), %ecx
testl %ecx, %ecx
je 0x58ca
cmpl $0x2e, %ecx
jne 0x58fa
cmpb $0x0, 0x15(%rax)
je 0x58ca
addq $0x13, %rbx
movzbl 0x12(%rax), %eax
cmpl $0xa, %eax
je 0x599a
cmpl $0x8, %eax
je 0x599a
cmpl $0x4, %eax
jne 0x58ca
movq %r15, %rdi
leaq 0x30(%rsp), %rsi
movq %rbx, %rdx
callq 0x9d7c
movq %r13, %rdi
movq %r15, %rsi
leaq 0xb4ed(%rip), %rdx      # 0x10e23
callq 0x9e6c
movq %r15, %rdi
callq 0x4170
movq %r15, %rdi
leaq 0x10(%rsp), %rsi
callq 0x4510
leaq 0xa8(%rsp), %rdi
movq %r13, %rsi
callq 0x4200
leaq 0xc8(%rsp), %rdi
movq %r15, %rsi
callq 0x4200
leaq 0x130(%rsp), %rdi
leaq 0xa8(%rsp), %rsi
callq 0xa6b2
movq %r15, %rdi
callq 0x4170
movq %r13, %rdi
callq 0x4170
jmp 0x58ca
movq %r14, %rdi
callq 0x9d36
movq %r12, %rdi
callq 0x9d36
movq %r15, %rdi
callq 0x9d06
movq %r13, %rdi
leaq 0x30(%rsp), %rsi
movq %rbx, %rdx
callq 0x9d7c
movq %r14, %rdi
movq %r13, %rsi
callq 0x44a0
movq %r13, %rdi
callq 0x4170
movq %r13, %rdi
leaq 0x10(%rsp), %rsi
movq %rbx, %rdx
callq 0x9d7c
movq %r12, %rdi
movq %r13, %rsi
callq 0x44a0
movq %r13, %rdi
callq 0x4170
movq 0xe8(%rsp), %rdi
xorl %esi, %esi
xorl %eax, %eax
callq 0x4280
movl %eax, %ebx
testl %eax, %eax
js 0x5a97
movl %ebx, %edi
movq %r13, %rsi
callq 0x4650
movl %ebx, %edi
callq 0x4740
movq 0x248(%rsp), %rax
movq %rax, 0x1c0(%rsp)
movq %rax, 0x108(%rsp)
movq %r15, %rdi
movq %r14, %rsi
callq 0x9d5a
leaq 0x1f0(%rsp), %rdi
movq %r12, %rsi
callq 0x9d5a
movq %r15, %rdi
callq 0x9c33
testl %eax, %eax
js 0x5ad9
lock
incq 0x11a7d(%rip)           # 0x174e8
movq 0x248(%rsp), %rax
addq %rax, 0x11aa6(%rip)     # 0x17520
movq %r15, %rdi
callq 0x9db4
movq %r12, %rdi
callq 0x4170
movq %r14, %rdi
callq 0x4170
jmp 0x58ca
movq 0x1152a(%rip), %rax     # 0x16fc8
movq (%rax), %rax
movq %rax, 0x50(%rsp)
movq 0xe8(%rsp), %rax
movq %rax, 0x58(%rsp)
negl %ebx
movl %ebx, %edi
callq 0x4110
movq 0x50(%rsp), %rdi
leaq 0xb236(%rip), %rsi      # 0x10cfe
movq 0x58(%rsp), %rdx
movq %rax, %rcx
xorl %eax, %eax
callq 0x4530
jmp 0x5a7a
movq %r15, %rdi
callq 0x9db4
movq %r12, %rdi
callq 0x4170
movq %r14, %rdi
callq 0x4170
movq %rbp, %rdi
callq 0x4600
leaq 0x110(%rsp), %rbx
movq %rbx, %rdi
callq 0x4170
leaq 0x10(%rsp), %rdi
callq 0x4170
leaq 0x30(%rsp), %rdi
callq 0x4170
movl 0x4(%rsp), %ecx
incl %ecx
testq %rbp, %rbp
movq %rbx, %rbp
leaq 0xa8(%rsp), %rbx
jne 0x5805
jmp 0x5bfd
movq 0x11485(%rip), %rax     # 0x16fc8
movq (%rax), %rdi
movq 0x30(%rsp), %rdx
leaq 0xb18c(%rip), %rsi      # 0x10cde
xorl %eax, %eax
callq 0x4530
jmp 0x5af9
cmpl $-0x2, %eax
jne 0x5c33
movq 0x1145d(%rip), %rax     # 0x16fc8
movq (%rax), %rdi
movq (%r14), %rdx
leaq 0xb261(%rip), %rsi      # 0x10dd9
xorl %eax, %eax
callq 0x4530
jmp 0x5c33
movq 0x1143d(%rip), %rax     # 0x16fc8
movq (%rax), %rdi
movq 0x88(%rsp), %rdx
leaq 0xb1ab(%rip), %rsi      # 0x10d48
jmp 0x5bb5
movq 0x11422(%rip), %rax     # 0x16fc8
movq (%rax), %rdi
movq 0x68(%rsp), %rdx
leaq 0xb0ee(%rip), %rsi      # 0x10ca3
xorl %eax, %eax
callq 0x4530
jmp 0x5c1c
movq 0x11403(%rip), %rax     # 0x16fc8
movq (%rax), %rdi
leaq 0x10(%rsp), %rbx
movq (%rbx), %rdx
leaq 0xb0ec(%rip), %rsi      # 0x10cc3
xorl %eax, %eax
callq 0x4530
leaq 0x110(%rsp), %rdi
callq 0x4170
movq %rbx, %rdi
callq 0x4170
leaq 0x30(%rsp), %rdi
callq 0x4170
leaq 0xa8(%rsp), %rdi
callq 0xa490
leaq 0x130(%rsp), %rdi
callq 0xad28
movq 0x8(%rsp), %r12
leaq 0x68(%rsp), %rdi
callq 0x4170
leaq 0x88(%rsp), %rdi
callq 0x4170
movq %r12, %rdi
callq 0xe196
pushq $0x1
popq %rax
xchgl %eax, 0x11894(%rip)     # 0x174d8
leaq 0x11845(%rip), %rdi     # 0x17490
callq 0x4660
movq %r12, %rdi
callq 0xc1c4
pushq $0x8
popq %rsi
movq %r12, %rdi
callq 0x43f0
addq $0x2a8, %rsp            # imm = 0x2A8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
leaq 0x180(%rsp), %rdi
callq 0x4170
jmp 0x5d75
movq %rax, %rbx
jmp 0x5d7f
movq %rax, %rbx
pushq $0x8
popq %rsi
movq %r12, %rdi
callq 0x43f0
jmp 0x5d8c
jmp 0x5cc1
movq %rax, %rbx
jmp 0x5d75
movq %rax, %rbx
jmp 0x5d51
movq %rax, %rbx
jmp 0x5d47
jmp 0x5cc1
movq %rax, %rbx
jmp 0x5d5b
jmp 0x5d0b
movq %rax, %rbx
jmp 0x5d01
jmp 0x5d0b
movq %rax, %rbx
leaq 0x1c8(%rsp), %rdi
jmp 0x5d35
jmp 0x5d10
jmp 0x5d10
jmp 0x5d10
movq %rax, %rbx
jmp 0x5d20
movq %rax, %rbx
jmp 0x5d2d
jmp 0x5d0b
movq %rax, %rbx
leaq 0x1c8(%rsp), %rdi
callq 0x4170
leaq 0x218(%rsp), %rdi
jmp 0x5d35
movq %rax, %rbx
jmp 0x5d3a
movq %rax, %rbx
leaq 0x1c8(%rsp), %rdi
callq 0x9db4
leaq 0x1a0(%rsp), %rdi
callq 0x4170
leaq 0xe8(%rsp), %rdi
callq 0x4170
leaq 0x110(%rsp), %rdi
callq 0x4170
leaq 0x10(%rsp), %rdi
callq 0x4170
leaq 0x30(%rsp), %rdi
callq 0x4170
leaq 0xa8(%rsp), %rdi
callq 0xa490
leaq 0x130(%rsp), %rdi
callq 0xad28
leaq 0x68(%rsp), %rdi
callq 0x4170
leaq 0x88(%rsp), %rdi
callq 0x4170
movq %rbx, %rdi
callq 0x46a0