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

    ftplib * ftpClient = new ftplib();
    int ret = connect_and_login_ftp (ftpClient, pFtp, 0);
    if (ret < 0) {
        if (ret == -2)
            fprintf(stderr, "\nthread %d : login ftp server %s failed: %s\n",\
                     id, pFtp->ftpServer, ftpClient->mp_ftphandle->response);
        goto error_out;
    }

    // create work directory
    ftpPath = ftpPath + pRecv->testName +  "_thread_" + to_string(id);
    if (!ftpClient->Chdir(ftpPath.c_str())) {
        if (!ftpClient->Mkdir(ftpPath.c_str())) {
            fprintf(stderr, "make directory %s failed: %s\n",\
                ftpPath.c_str(), ftpClient->mp_ftphandle->response);
            goto error_out;
        }
    }

    null2ftp_worker_core(pRecv, ftpClient, ftpPath, 1, pFtp);	

error_out:
    ftpClient->Quit();
    delete ftpClient;
    --liveWorkThread;
	return;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xc8, %rsp
movl %ecx, %ebp
movq %rdx, %r12
movq %rsi, %r15
movq %rdi, %r14
leaq 0x8a41(%rip), %rsi      # 0x108f2
leaq 0xa8(%rsp), %rbx
leaq 0x88(%rsp), %rdx
movq %rbx, %rdi
callq 0x9dca
movq %rbx, %rdi
movq %r12, %rsi
callq 0xbe13
pushq $0x8
popq %rdi
callq 0x43e0
movq %rax, %rbx
movq %rax, %rdi
callq 0xc110
movq %rbx, %rdi
movq %r14, %rsi
callq 0x54b6
testl %eax, %eax
js 0x7fcf
leaq 0x48(%rsp), %rdi
movq %r12, %rsi
movq %r15, %rdx
callq 0x9e8b
leaq 0x876b(%rip), %rdx      # 0x1067c
leaq 0x68(%rsp), %rdi
leaq 0x48(%rsp), %rsi
callq 0x9e6c
leaq 0x28(%rsp), %rdi
movl %ebp, %esi
callq 0x9ec3
leaq 0x88(%rsp), %rdi
leaq 0x68(%rsp), %rsi
leaq 0x28(%rsp), %rdx
callq 0x9e05
leaq 0x88(%rsp), %r13
movq %r12, %rdi
movq %r13, %rsi
callq 0x44a0
movq %r13, %rdi
callq 0x4170
leaq 0x28(%rsp), %rdi
callq 0x4170
leaq 0x68(%rsp), %rdi
callq 0x4170
leaq 0x48(%rsp), %rdi
callq 0x4170
movq (%r12), %rsi
movq %rbx, %rdi
callq 0xdace
testl %eax, %eax
jne 0x7fa0
movq (%r12), %rsi
movq %rbx, %rdi
callq 0xda6a
testl %eax, %eax
je 0x803d
leaq 0x8(%rsp), %rdi
movq %r12, %rsi
callq 0x4510
leaq 0x8(%rsp), %rdx
pushq $0x1
popq %rcx
movq %r15, %rdi
movq %rbx, %rsi
movq %r14, %r8
callq 0x80cb
leaq 0x8(%rsp), %rdi
callq 0x4170
jmp 0x7fd4
cmpl $-0x2, %eax
je 0x8015
movq %rbx, %rdi
callq 0xe196
movq %rbx, %rdi
callq 0xc1c4
pushq $0x8
popq %rsi
movq %rbx, %rdi
callq 0x43f0
lock
decl 0xf4ea(%rip)            # 0x174e0
leaq 0xa8(%rsp), %rdi
callq 0x4170
addq $0xc8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0xefac(%rip), %rax      # 0x16fc8
movq (%rax), %rdi
movq (%r14), %rcx
movl $0x88, %r8d
addq (%rbx), %r8
leaq 0x861d(%rip), %rsi      # 0x1064f
movl %ebp, %edx
xorl %eax, %eax
callq 0x4530
jmp 0x7fd4
movq 0xef84(%rip), %rax      # 0x16fc8
movq (%rax), %rdi
movq (%r12), %rdx
movl $0x88, %ecx
addq (%rbx), %rcx
leaq 0x862b(%rip), %rsi      # 0x10685
xorl %eax, %eax
callq 0x4530
jmp 0x7fd4
movq %rax, %r14
leaq 0x8(%rsp), %rdi
jmp 0x8096
movq %rax, %r14
leaq 0x28(%rsp), %rdi
callq 0x4170
jmp 0x8082
movq %rax, %r14
leaq 0x68(%rsp), %rdi
callq 0x4170
jmp 0x8091
movq %rax, %r14
leaq 0x48(%rsp), %rdi
callq 0x4170
jmp 0x80b6
jmp 0x80b3
movq %rax, %r14
pushq $0x8
popq %rsi
movq %rbx, %rdi
callq 0x43f0
jmp 0x80b6
jmp 0x80b3
jmp 0x80b3
movq %rax, %r14
leaq 0xa8(%rsp), %rdi
callq 0x4170
movq %r14, %rdi
callq 0x46a0