// File: 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
movq %rsp, %rbp
subq $0x170, %rsp            # imm = 0x170
movq %rdx, -0x118(%rbp)
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movl %ecx, -0x1c(%rbp)
leaq -0x41(%rbp), %rdi
movq %rdi, -0x110(%rbp)
callq 0x4820
movq -0x110(%rbp), %rdx
leaq 0x128fd(%rip), %rsi     # 0x1c94c
leaq -0x40(%rbp), %rdi
callq 0xd720
jmp 0xa05a
leaq -0x41(%rbp), %rdi
callq 0x4510
movq -0x118(%rbp), %rsi
leaq -0x40(%rbp), %rdi
callq 0x15d20
jmp 0xa075
movl $0x8, %edi
callq 0x44b0
movq %rax, -0x120(%rbp)
jmp 0xa088
movq -0x120(%rbp), %rdi
callq 0x16370
jmp 0xa096
movq -0x120(%rbp), %rax
movq %rax, -0x60(%rbp)
movq -0x60(%rbp), %rdi
movq -0x8(%rbp), %rsi
xorl %edx, %edx
callq 0x5dd0
movl %eax, -0x124(%rbp)
jmp 0xa0b8
movl -0x124(%rbp), %eax
movl %eax, -0x64(%rbp)
cmpl $0x0, -0x64(%rbp)
jge 0xa155
cmpl $-0x2, -0x64(%rbp)
jne 0xa150
movq 0x1bef0(%rip), %rax     # 0x25fc8
movq (%rax), %rdi
movl -0x1c(%rbp), %edx
movq -0x8(%rbp), %rax
movq (%rax), %rcx
movq -0x60(%rbp), %rax
movq (%rax), %r8
addq $0x88, %r8
leaq 0x125ad(%rip), %rsi     # 0x1c6a7
movb $0x0, %al
callq 0x4680
jmp 0xa150
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
leaq -0x41(%rbp), %rdi
callq 0x4510
jmp 0xa3ea
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
jmp 0xa3e1
movq -0x120(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
movl $0x8, %esi
callq 0x44c0
jmp 0xa3e1
jmp 0xa372
movq -0x118(%rbp), %rsi
movq -0x10(%rbp), %rdx
leaq -0xc8(%rbp), %rdi
callq 0xd8f0
jmp 0xa16e
leaq 0x1255f(%rip), %rdx     # 0x1c6d4
leaq -0xa8(%rbp), %rdi
leaq -0xc8(%rbp), %rsi
callq 0xd8a0
jmp 0xa18a
movl -0x1c(%rbp), %esi
leaq -0xe8(%rbp), %rdi
callq 0xd970
jmp 0xa19b
leaq -0x88(%rbp), %rdi
leaq -0xa8(%rbp), %rsi
leaq -0xe8(%rbp), %rdx
callq 0xd7d0
jmp 0xa1b7
movq -0x118(%rbp), %rdi
leaq -0x88(%rbp), %rsi
movq %rsi, -0x138(%rbp)
callq 0x45c0
movq -0x138(%rbp), %rdi
callq 0x4280
leaq -0xe8(%rbp), %rdi
callq 0x4280
leaq -0xa8(%rbp), %rdi
callq 0x4280
leaq -0xc8(%rbp), %rdi
callq 0x4280
movq -0x118(%rbp), %rdi
movq -0x60(%rbp), %rax
movq %rax, -0x130(%rbp)
callq 0x41b0
movq -0x130(%rbp), %rdi
movq %rax, %rsi
callq 0x18d00
movl %eax, -0x128(%rbp)
jmp 0xa22f
movl -0x128(%rbp), %eax
cmpl $0x0, %eax
jne 0xa316
movq -0x118(%rbp), %rdi
movq -0x60(%rbp), %rax
movq %rax, -0x148(%rbp)
callq 0x41b0
movq -0x148(%rbp), %rdi
movq %rax, %rsi
callq 0x18c60
movl %eax, -0x13c(%rbp)
jmp 0xa26c
movl -0x13c(%rbp), %eax
cmpl $0x0, %eax
jne 0xa314
movq -0x118(%rbp), %rdi
movq 0x1bd3f(%rip), %rax     # 0x25fc8
movq (%rax), %rax
movq %rax, -0x150(%rbp)
callq 0x41b0
movq -0x150(%rbp), %rdi
movq %rax, %rdx
movq -0x60(%rbp), %rax
movq (%rax), %rcx
addq $0x88, %rcx
leaq 0x12426(%rip), %rsi     # 0x1c6dd
movb $0x0, %al
callq 0x4680
jmp 0xa372
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
jmp 0xa303
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
jmp 0xa2f7
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
leaq -0xe8(%rbp), %rdi
callq 0x4280
leaq -0xa8(%rbp), %rdi
callq 0x4280
leaq -0xc8(%rbp), %rdi
callq 0x4280
jmp 0xa3e1
jmp 0xa316
movq -0x118(%rbp), %rsi
movq -0x10(%rbp), %rax
movq %rax, -0x160(%rbp)
movq -0x60(%rbp), %rax
movq %rax, -0x158(%rbp)
leaq -0x108(%rbp), %rdi
callq 0x41c0
jmp 0xa341
movq -0x158(%rbp), %rsi
movq -0x160(%rbp), %rdi
movq -0x8(%rbp), %r8
leaq -0x108(%rbp), %rdx
movl $0x1, %ecx
callq 0xa400
jmp 0xa366
leaq -0x108(%rbp), %rdi
callq 0x4280
movq -0x60(%rbp), %rdi
callq 0x197d0
jmp 0xa37d
movq -0x60(%rbp), %rax
movq %rax, -0x168(%rbp)
cmpq $0x0, %rax
je 0xa3ab
movq -0x168(%rbp), %rdi
callq 0x164c0
movq -0x168(%rbp), %rdi
movl $0x8, %esi
callq 0x44c0
leaq 0x1c23e(%rip), %rdi     # 0x265f0
callq 0xd3c0
leaq -0x40(%rbp), %rdi
callq 0x4280
addq $0x170, %rsp            # imm = 0x170
popq %rbp
retq
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
leaq -0x108(%rbp), %rdi
callq 0x4280
leaq -0x40(%rbp), %rdi
callq 0x4280
movq -0x50(%rbp), %rdi
callq 0x4810
nopw %cs:(%rax,%rax)