LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_cpp_makefile_star2_O1/WShabti-Team[P]WShabtiPict/wshabtilib/api/pictapi.cpp
// Function: PictAttachChildModel
PICT_RET_CODE
API_SPEC
PictAttachChildModel
    (
    IN const PICT_HANDLE modelParent,
    IN const PICT_HANDLE modelChild,
    IN OPT unsigned int  order
    )
{
    Model* parent = static_cast<Model*>( NO_CONST_HANDLE( modelParent ));
    Model* child  = static_cast<Model*>( NO_CONST_HANDLE( modelChild  ));
    try
    {
        child->SetOrder( order );
        if ( parent->GetOrder() < static_cast<int>( order ))
        {
            parent->SetOrder( order );
        }
        
        parent->AddSubmodel( child );
        return( PICT_SUCCESS );
    }
    catch( ... )
    {
        return( PICT_OUT_OF_MEMORY );
    }
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %r14
movq %rdi, %rbx
movl %edx, 0x108(%rsi)
cmpl %edx, 0x108(%rdi)
jge 0xfc8a
movl %edx, 0x108(%rbx)
movl $0x18, %edi
callq 0x53c0
leaq 0x50(%rbx), %rsi
movq %r14, 0x10(%rax)
movq %rax, %rdi
callq 0x5080
incq 0x60(%rbx)
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
movq %rax, %rdi
callq 0x5190
callq 0x5650
movl $0xc0000001, %eax       # imm = 0xC0000001
jmp 0xfcaa
// File: /workspace/github_cpp_makefile_star2_O1/WShabti-Team[P]WShabtiPict/wshabtilib/api/pictapi.cpp
// Function: PictDeleteModel
void
API_SPEC
PictDeleteModel
    (
    IN const PICT_HANDLE model
    )
{
    Model* modelObj = static_cast<Model*>( NO_CONST_HANDLE( model ));

    // delete all params first
    // since GetParameters() will return all params for this and all submodels, do it here
    for( Parameter* param : modelObj->GetParameters() )
    {
        delete( param );
    }

    // and this model, Model::~Model will clean up all submodels too
    delete( modelObj );
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdi, %rbx
movq 0x8(%rdi), %r14
movq 0x10(%rdi), %r15
cmpq %r15, %r14
je 0xfcef
movq (%r14), %rdi
testq %rdi, %rdi
je 0xfce9
movq (%rdi), %rax
callq *0x8(%rax)
addq $0x8, %r14
jmp 0xfcd6
movq %rbx, %rdi
callq 0xbf4a
movl $0x150, %esi            # imm = 0x150
movq %rbx, %rdi
popq %rbx
popq %r14
popq %r15
jmp 0x53e0
nop
// File: /workspace/github_cpp_makefile_star2_O1/WShabti-Team[P]WShabtiPict/wshabtilib/api/task.cpp
// Function: pictcore::Task::Task()
Task::Task() :
      m_rootModel     (NULL),
      m_abortCallback (NULL),
      m_generationMode(Regular),
      m_maxRandomTries(DefaultMaxRandomTries),
      m_workbuf       (NULL)
{
    Combination::ResetId();

#if ( defined(_DOUT) || defined(_FILE) )
    wcerr << L"WARNING: _DOUT or _FILE are defined\n";
#endif

#if ( defined(_DOUT) && defined(_FILE) )
    logfile.open( "\\generator.log", ofstream::out );
#endif
}

// Assembly:
xorl %eax, %eax
movq %rax, (%rdi)
leaq 0x10(%rdi), %rcx
movl %eax, 0x10(%rdi)
movq %rax, 0x18(%rdi)
movq %rcx, 0x20(%rdi)
movq %rcx, 0x28(%rdi)
movq %rax, 0x30(%rdi)
leaq 0x38(%rdi), %rcx
movq %rcx, 0x40(%rdi)
movq %rcx, 0x38(%rdi)
xorps %xmm0, %xmm0
movups %xmm0, 0x48(%rdi)
movl %eax, 0x58(%rdi)
movq $0x3e8, 0x60(%rdi)      # imm = 0x3E8
movups %xmm0, 0x68(%rdi)
leaq 0x2552b(%rip), %rcx     # 0x357e8
movl %eax, (%rcx)
retq
// File: /workspace/github_cpp_makefile_star2_O1/WShabti-Team[P]WShabtiPict/wshabtilib/api/task.cpp
// Function: pictcore::Task::~Task()
Task::~Task()
{
    DeallocWorkbuf();

#if ( defined(_DOUT) && defined(_FILE) )
    logfile.close();
#endif
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
movq 0x68(%rdi), %rdi
testq %rdi, %rdi
je 0x102da
callq 0x5520
movq $0x0, 0x68(%rbx)
leaq 0x38(%rbx), %rdi
callq 0xd302
addq $0x8, %rbx
movq %rbx, %rdi
popq %rbx
jmp 0xcc6c
// File: /workspace/github_cpp_makefile_star2_O1/WShabti-Team[P]WShabtiPict/wshabtilib/api/task.cpp
// Function: pictcore::Task::PrepareForGeneration()
void Task::PrepareForGeneration()
{
    // new models could have been added to the root
    // repropagate the task pointer to all models
    m_rootModel->WireTask(this);

    // run the deriver on exclusions
    deriveExclusions();

    // propagate exclusions wiring to appropriate submodel
    // add each exclusion to that model in the hierarchy which is the most suitable:
    //  1. a subtree of that model must have all the parameters of the exclusion
    //  2. no lower subtree satisfies the condition 1)
    //
    for ( auto & excl : m_exclusions )
    {
        Model* found = findMatchingNode(const_cast<Exclusion&>( excl ), m_rootModel);
        assert( NULL != found );
        found->AddExclusion( const_cast<Exclusion&>( excl ));
    }

    // propagate all row seeds
    m_rootModel->AddRowSeeds( m_rowSeeds.begin(), m_rowSeeds.end() );
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq (%rdi), %rdi
movq %rbx, %rsi
callq 0xff54
movq %rbx, %rdi
callq 0x10406
movq 0x20(%rbx), %r14
leaq 0x10(%rbx), %r12
cmpq %r12, %r14
je 0x103b3
leaq 0x20(%r14), %r15
movq (%rbx), %rdx
movq %rbx, %rdi
movq %r15, %rsi
callq 0x10550
testq %rax, %rax
je 0x103e6
addq $0x20, %rax
movq %rax, %rdi
movq %r15, %rsi
callq 0x8066
movq %r14, %rdi
callq 0x54b0
movq %rax, %r14
cmpq %r12, %rax
jne 0x1037d
movq 0x38(%rbx), %rsi
leaq 0x38(%rbx), %r14
cmpq %r14, %rsi
je 0x103da
movq (%rbx), %rbx
movq (%rsi), %r15
addq $0x10, %rsi
movq %rbx, %rdi
callq 0x1067c
movq %r15, %rsi
cmpq %r14, %r15
jne 0x103c3
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
leaq 0x1666a(%rip), %rdi     # 0x26a57
leaq 0x16671(%rip), %rsi     # 0x26a65
leaq 0x16682(%rip), %rcx     # 0x26a7d
movl $0x53, %edx
callq 0x52c0
nop
// File: /workspace/github_cpp_makefile_star2_O1/WShabti-Team[P]WShabtiPict/wshabtilib/api/task.cpp
// Function: pictcore::Task::deriveExclusions()
void Task::deriveExclusions()
{
    ExclusionDeriver deriver(this);
    ParamCollection params;
    m_rootModel->GetAllParameters(params);

    for( auto p : params )
    {
        deriver.AddParameter( p );
    }

    for( auto & excl : m_exclusions )
    {
        deriver.AddExclusion( const_cast<Exclusion&>( excl ), true );
    }

    deriver.DeriveExclusions();
    
    // must clear and repopulate the collection with the result of the derivation
    m_exclusions.clear();
    __insert( m_exclusions, deriver.GetExclusions().begin(), deriver.GetExclusions().end() );
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0xd8, %rsp
movq %rdi, %rbx
leaq 0x18(%rsp), %rdi
movq %rbx, %rsi
callq 0xc232
xorps %xmm0, %xmm0
movq %rsp, %rsi
movaps %xmm0, (%rsi)
movq $0x0, 0x10(%rsi)
movq (%rbx), %rdi
callq 0xc304
movq (%rsp), %r15
movq 0x8(%rsp), %r12
cmpq %r12, %r15
je 0x10464
leaq 0x18(%rsp), %r14
movq (%r15), %rsi
movq %r14, %rdi
callq 0xc344
addq $0x8, %r15
cmpq %r12, %r15
jne 0x10450
movq 0x20(%rbx), %r14
leaq 0x10(%rbx), %r12
cmpq %r12, %r14
je 0x10497
leaq 0x18(%rsp), %r15
leaq 0x20(%r14), %rsi
movq %r15, %rdi
movl $0x1, %edx
callq 0x648c
movq %r14, %rdi
callq 0x54b0
movq %rax, %r14
cmpq %r12, %rax
jne 0x10476
leaq 0x18(%rsp), %rdi
callq 0x6756
addq $0x8, %rbx
movq %rbx, %rdi
callq 0xecce
leaq 0x38(%rsp), %rdx
movq 0x10(%rdx), %rsi
movq %rbx, %rdi
callq 0xc1fc
leaq 0x30(%rsp), %rbx
movq (%rsp), %rdi
testq %rdi, %rdi
je 0x104d9
movq 0x10(%rsp), %rsi
subq %rdi, %rsi
callq 0x53e0
leaq 0xc8(%rsp), %rdi
callq 0xcd0c
leaq 0x78(%rsp), %r14
movq %r14, %rdi
callq 0xd476
movq %rbx, %rdi
callq 0xcc6c
movq -0x60(%r14), %rdi
testq %rdi, %rdi
je 0x10511
movq 0x28(%rsp), %rsi
subq %rdi, %rsi
callq 0x53e0
addq $0xd8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
jmp 0x10524
jmp 0x10524
movq %rax, %rbx
movq (%rsp), %rdi
testq %rdi, %rdi
je 0x1053d
movq 0x10(%rsp), %rsi
subq %rdi, %rsi
callq 0x53e0
leaq 0x18(%rsp), %rdi
callq 0xc36a
movq %rbx, %rdi
callq 0x56a0
nop
// File: /workspace/github_cpp_makefile_star2_O1/WShabti-Team[P]WShabtiPict/wshabtilib/api/task.cpp
// Function: pictcore::Task::findMatchingNode(pictcore::Exclusion&, pictcore::Model*)
Model* Task::findMatchingNode( Exclusion& exclusion, Model* root )
{
    // can any of the subnodes accommodate the exclusion?
    for( auto & submodel : root->GetSubmodels() )
    {
        Model* foundNode = findMatchingNode( exclusion, submodel );
        if ( NULL != foundNode ) return( foundNode );
    }

    // none of the subnodes matches the exclusion so let's try the current one
    bool foundParams = true;
    for( auto & term : exclusion )
    {
        foundParams = findParamInSubtree( term.first, root );
        if ( ! foundParams ) break;
    }
    if ( foundParams )
    {
        return( root );
    }
    else
    {
        return( NULL );
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %rbx
movq %rsi, %r14
movq %rdi, %r15
leaq 0x50(%rdx), %r13
movq %r13, %rbp
movq (%rbp), %rbp
cmpq %r13, %rbp
je 0x1058c
movq 0x10(%rbp), %rdx
movq %r15, %rdi
movq %r14, %rsi
callq 0x10550
testq %rax, %rax
cmovneq %rax, %r12
je 0x1056b
cmpq %r13, %rbp
jne 0x105c7
movq 0x18(%r14), %r13
addq $0x8, %r14
cmpq %r14, %r13
je 0x105c4
xorl %r12d, %r12d
movq 0x20(%r13), %rsi
movq %r15, %rdi
movq %rbx, %rdx
callq 0x10604
testb %al, %al
je 0x105c7
movq %r13, %rdi
callq 0x54b0
movq %rax, %r13
cmpq %r14, %rax
jne 0x105a1
movq %rbx, %r12
movq %r12, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/WShabti-Team[P]WShabtiPict/wshabtilib/api/task.cpp
// Function: pictcore::Task::findParamInSubtree(pictcore::Parameter*, pictcore::Model*)
bool Task::findParamInSubtree( Parameter* parameter, Model* root )
{
    // check if exists in current node collection
    for( auto p : root->GetParameters() )
    {
        if ( p == parameter ) return( true );
    }

    // check if exists in any of the children
    for( auto & submodel : root->GetSubmodels() )
    {
        bool found = findParamInSubtree( parameter, submodel );
        if ( found ) return( true );
    }

    return( false );
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rdx, %rbx
movq %rsi, %r14
movq %rdi, %r15
movq 0x8(%rdx), %rcx
movq 0x10(%rdx), %rax
cmpq %rax, %rcx
sete %dl
je 0x10649
cmpq %r14, (%rcx)
je 0x10642
addq $0x8, %rcx
cmpq %rax, %rcx
sete %dl
je 0x10649
leaq 0x8(%rcx), %rsi
cmpq %r14, (%rcx)
movq %rsi, %rcx
jne 0x1062e
movb $0x1, %bpl
testb %dl, %dl
je 0x10671
addq $0x50, %rbx
movq %rbx, %r12
movq (%r12), %r12
cmpq %rbx, %r12
setne %bpl
je 0x10671
movq 0x10(%r12), %rdx
movq %r15, %rdi
movq %r14, %rsi
callq 0x10604
testb %al, %al
je 0x10650
movl %ebp, %eax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/WShabti-Team[P]WShabtiPict/wshabtilib/api/worklist.cpp
// Function: pictcore::WorkList::AddItem(pictcore::Parameter*)
void WorkList::AddItem( Parameter* param )
{
    if( !param->IsPending() )
    {
        assert( !param->GetBoundCount() );
        m_rep.push_back( param );
        param->MarkPending();
    }
}

// Assembly:
pushq %rax
movq %rsi, (%rsp)
cmpb $0x0, 0x3e(%rsi)
jne 0x10704
cmpb $0x1, 0x3d(%rsi)
je 0x10706
movq 0x30(%rdi), %rax
movq 0x40(%rdi), %rcx
addq $-0x8, %rcx
cmpq %rcx, %rax
je 0x106f4
movq %rsi, (%rax)
addq $0x8, 0x30(%rdi)
jmp 0x106fc
movq %rsp, %rsi
callq 0x7e36
movq (%rsp), %rax
movb $0x1, 0x3e(%rax)
popq %rax
retq
leaq 0x16040(%rip), %rdi     # 0x2674d
leaq 0x16395(%rip), %rsi     # 0x26aa9
leaq 0x163aa(%rip), %rcx     # 0x26ac5
movl $0xe, %edx
callq 0x52c0
nop
// File: /workspace/github_cpp_makefile_star2_O1/WShabti-Team[P]WShabtiPict/wshabtilib/utils/utils.cpp
// Function: position_in_vector(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>>>>, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>)
int position_in_vector(vector<string> vect, string target)
{
    for(int i=0; i<vect.size(); i++)
    {
        if(vect[i].compare(target) == 0)
        {
            return i;
        }
    }
    return -1;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %rdi, %r15
movq (%rdi), %rdi
movl $0xffffffff, %ebx       # imm = 0xFFFFFFFF
cmpq %rdi, 0x8(%r15)
je 0x1092e
movq %rsi, %r14
xorl %r12d, %r12d
xorl %r13d, %r13d
addq %r12, %rdi
movq %r14, %rsi
callq 0x5050
testl %eax, %eax
je 0x1092b
incq %r13
movq (%r15), %rdi
movq 0x8(%r15), %rax
subq %rdi, %rax
sarq $0x5, %rax
addq $0x20, %r12
cmpq %r13, %rax
ja 0x10900
jmp 0x1092e
movl %r13d, %ebx
movl %ebx, %eax
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O1/WShabti-Team[P]WShabtiPict/wshabtilib/input-parser/input-parser.cpp
// Function: input_parser(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, std::vector<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>>>>, std::allocator<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>>>>>>&, std::vector<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>>>>, std::allocator<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>>>>>>&)
void input_parser(string input_file_path, vector<vector<string>> &parameter_matrix, vector<vector<string>> &constraint_matrix)
{
	
	std::ifstream input_file;
  	input_file.open(input_file_path, std::ios_base::in);

	parameter_parser(input_file, parameter_matrix);
	constraint_parser(input_file, constraint_matrix);
	
	input_file.close();
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x208, %rsp            # imm = 0x208
movq %rdx, %rbx
movq %rsi, %r14
movq %rdi, %r15
movq %rsp, %r12
movq %r12, %rdi
callq 0x5480
movq %r12, %rdi
movq %r15, %rsi
movl $0x8, %edx
callq 0x5360
movq %rsp, %rdi
movq %r14, %rsi
callq 0x10ea6
movq %rsp, %rdi
movq %rbx, %rsi
callq 0x118ea
movq %rsp, %rdi
callq 0x50c0
movq %rsp, %rdi
callq 0x50d0
addq $0x208, %rsp            # imm = 0x208
popq %rbx
popq %r12
popq %r14
popq %r15
retq
movq %rax, %rbx
movq %rsp, %rdi
callq 0x50d0
movq %rbx, %rdi
callq 0x56a0
// File: /workspace/github_cpp_makefile_star2_O1/WShabti-Team[P]WShabtiPict/wshabtilib/java-source-code-parser/java-source-code-parser.cpp
// Function: get_method_and_values_name(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>)
vector<string> get_method_and_values_name(string method_prototype)
{
    smatch sm;
    vector<string> method_values_name;
    regex method_and_value_name_regex (R"rgx(\b\w+(?=\s*[,()]))rgx");

    while(regex_search(method_prototype, sm, method_and_value_name_regex))
    {
        method_values_name.push_back(sm[0]);
        method_prototype = sm.suffix();
    }
    return method_values_name;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x68, %rsp
movq %rsi, %r14
movq %rdi, %rbx
xorps %xmm0, %xmm0
movaps %xmm0, 0x30(%rsp)
movaps %xmm0, 0x20(%rsp)
movups %xmm0, (%rdi)
movq $0x0, 0x10(%rdi)
leaq 0x14760(%rip), %rsi     # 0x26d71
leaq 0x48(%rsp), %rdi
movl $0x10, %edx
callq 0x1283a
leaq 0x10(%rsp), %rbp
leaq 0x20(%rsp), %r15
leaq 0x48(%rsp), %r12
movq %rsp, %r13
movq (%r14), %rdi
movq 0x8(%r14), %rsi
addq %rdi, %rsi
movq %r15, %rdx
movq %r12, %rcx
xorl %r8d, %r8d
callq 0x1d889
testb %al, %al
je 0x12753
movq 0x20(%rsp), %rcx
movq 0x28(%rsp), %rdx
movq %rdx, %rax
subq %rcx, %rax
leaq -0x48(%rdx), %rsi
cmpq $0x48, %rax
movq %rcx, %rax
cmoveq %rsi, %rax
cmpq %rcx, %rdx
cmoveq %rsi, %rax
cmpb $0x1, 0x10(%rax)
jne 0x12693
movq (%rax), %rsi
movq 0x8(%rax), %rdx
movq %rbp, (%rsp)
movq %r13, %rdi
callq 0x1f8ce
jmp 0x126a5
movq %rbp, (%rsp)
movq $0x0, 0x8(%rsp)
movb $0x0, 0x10(%rsp)
movq %rbx, %rdi
movq %r13, %rsi
callq 0x10c22
movq (%rsp), %rdi
cmpq %rbp, %rdi
je 0x126c6
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x53e0
movq 0x28(%rsp), %rax
movq %rax, %rdx
subq 0x20(%rsp), %rdx
sarq $0x3, %rdx
movabsq $-0x5555555555555555, %rcx # imm = 0xAAAAAAAAAAAAAAAB
imulq %rcx, %rdx
movq $-0x48, %rcx
cmpq $0x4, %rdx
jb 0x126f9
movq $-0x18, %rcx
cmpb $0x1, 0x10(%rax,%rcx)
jne 0x12717
movq (%rax,%rcx), %rsi
movq 0x8(%rax,%rcx), %rdx
movq %rbp, (%rsp)
movq %r13, %rdi
callq 0x1f8ce
jmp 0x12729
movq %rbp, (%rsp)
movq $0x0, 0x8(%rsp)
movb $0x0, 0x10(%rsp)
movq %r14, %rdi
movq %r13, %rsi
callq 0x54e0
movq (%rsp), %rdi
cmpq %rbp, %rdi
je 0x12632
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x53e0
jmp 0x12632
leaq 0x48(%rsp), %rdi
callq 0x128a2
movq 0x20(%rsp), %rdi
testq %rdi, %rdi
je 0x12774
movq 0x30(%rsp), %rsi
subq %rdi, %rsi
callq 0x53e0
movq %rbx, %rax
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %r14
jmp 0x127b7
jmp 0x127aa
jmp 0x127aa
movq %rax, %r14
movq (%rsp), %rdi
cmpq %rbp, %rdi
je 0x127ad
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x53e0
jmp 0x127ad
movq %rax, %r14
leaq 0x48(%rsp), %rdi
callq 0x128a2
movq %rbx, %rdi
callq 0x10982
movq 0x20(%rsp), %rdi
testq %rdi, %rdi
je 0x127d6
movq 0x30(%rsp), %rsi
subq %rdi, %rsi
callq 0x53e0
movq %r14, %rdi
callq 0x56a0
// File: /workspace/github_cpp_makefile_star2_O1/WShabti-Team[P]WShabtiPict/wshabtilib/junit-test-case-generator/junit-test-case-generator.cpp
// Function: add_oracle_to_arguments(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, bool)
string add_oracle_to_arguments(string prototype, bool interval_found)
{
    string arguments_with_oracle = "";
    if(interval_found)
    {
        arguments_with_oracle = (prototype.replace(prototype.find(")"),prototype.find(")"), ", double oracle, double delta)")); 

    }
    else
    {
        arguments_with_oracle = (prototype.replace(prototype.find(")"),prototype.find(")"), ", Object oracle)")); 
    }
    return arguments_with_oracle;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %edx, %ebp
movq %rsi, %r14
movq %rdi, %rbx
leaq 0x10(%rdi), %r13
movq %r13, (%rdi)
leaq 0x8235(%rip), %rdx      # 0x27b9a
movq %rdx, %rsi
callq 0x7592
leaq 0x6c2d(%rip), %r15      # 0x265a1
movl $0x1, %ecx
movq %r14, %rdi
movq %r15, %rsi
xorl %edx, %edx
callq 0x5690
movq %rax, %r12
movl $0x1, %ecx
movq %r14, %rdi
movq %r15, %rsi
xorl %edx, %edx
callq 0x5690
leaq 0x8166(%rip), %rdx      # 0x27b08
leaq 0x817e(%rip), %rcx      # 0x27b27
testl %ebp, %ebp
cmovneq %rdx, %rcx
movl $0x1e, %edx
movl $0x10, %r8d
cmovneq %rdx, %r8
movq %r14, %rdi
movq %r12, %rsi
movq %rax, %rdx
callq 0x5460
movq %rbx, %rdi
movq %rax, %rsi
callq 0x5210
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %r14
movq (%rbx), %rdi
cmpq %r13, %rdi
je 0x1fa00
movq (%r13), %rsi
incq %rsi
callq 0x53e0
movq %r14, %rdi
callq 0x56a0
// File: /workspace/github_cpp_makefile_star2_O1/WShabti-Team[P]WShabtiPict/wshabtilib/junit-test-case-generator/junit-test-case-generator.cpp
// Function: delta_check(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, int)
bool delta_check(string input_file_path, int num_of_parameters)
{
    ifstream test_with_oracle;
  	test_with_oracle.open(input_file_path, ios_base::in);
    string combination = "";

    while(!test_with_oracle.eof())
    {
        getline(test_with_oracle, combination);

        if((int) count(combination.begin(), combination.end(), ',') == (num_of_parameters + 1)) //If there's delta it is TRUE (+1 parameter)
        {
            test_with_oracle.close();
            return true;
        }
    }

    test_with_oracle.close();
    return false;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x230, %rsp            # imm = 0x230
movl %esi, %ebx
movq %rdi, %r14
leaq 0x28(%rsp), %r15
movq %r15, %rdi
callq 0x5480
movq %r15, %rdi
movq %r14, %rsi
movl $0x8, %edx
callq 0x5360
leaq 0x18(%rsp), %r12
movq %r12, -0x10(%r12)
leaq 0x8150(%rip), %rdx      # 0x27b9a
leaq 0x8(%rsp), %rdi
movq %rdx, %rsi
callq 0x7592
incl %ebx
leaq 0x28(%rsp), %r14
leaq 0x8(%rsp), %r15
movq 0x28(%rsp), %rax
movq -0x18(%rax), %rax
movl 0x48(%rsp,%rax), %ebp
testb $0x2, %bpl
jne 0x1fac6
leaq (%rsp,%rax), %rdi
addq $0x28, %rdi
movl $0xa, %esi
callq 0x53b0
movsbl %al, %edx
movq %r14, %rdi
movq %r15, %rsi
callq 0x56f0
movq 0x10(%rsp), %rcx
testq %rcx, %rcx
je 0x1fac0
movq 0x8(%rsp), %rdx
xorl %esi, %esi
xorl %eax, %eax
xorl %edi, %edi
cmpb $0x2c, (%rdx,%rsi)
sete %dil
addq %rdi, %rax
incq %rsi
cmpq %rsi, %rcx
jne 0x1faa9
jmp 0x1fac2
xorl %eax, %eax
cmpl %eax, %ebx
jne 0x1fa63
leaq 0x28(%rsp), %rdi
callq 0x50c0
movq 0x8(%rsp), %rdi
cmpq %r12, %rdi
je 0x1fae7
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x53e0
testb $0x2, %bpl
sete %bl
leaq 0x28(%rsp), %rdi
callq 0x50d0
movl %ebx, %eax
addq $0x230, %rsp            # imm = 0x230
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
jmp 0x1fb13
jmp 0x1fb0e
movq %rax, %rbx
jmp 0x1fb2d
movq %rax, %rbx
movq 0x8(%rsp), %rdi
cmpq %r12, %rdi
je 0x1fb2d
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x53e0
leaq 0x28(%rsp), %rdi
callq 0x50d0
movq %rbx, %rdi
callq 0x56a0
// File: /workspace/github_cpp_makefile_star2_O1/lianxings[P]ftp_benchmark/ftp_benchmark.cc
// Function: connect_and_login_ftp(ftplib*, ftpInfo*, int)
static int connect_and_login_ftp (ftplib* ftpClient, ftpInfo* pFtp, int retryTime) 
{
    int retry = 0;
    static int seeded = 0;
    if (!seeded) {
        struct timeval tv;
        gettimeofday(&tv, NULL);
        srand((unsigned)tv.tv_usec);
        seeded = 1;
    }

    while (true) {
        if (ftpClient->Connect(pFtp->ftpServer)) {
            break;
        }
        
        if (retryTime > 0) {
            retry++;
            if (retry >= retryTime) {
                return -1;
            }
        } else {
            unsigned int sleepTime = rand();
            sleepTime = sleepTime % 31 + 2;
            sleep(sleepTime);
        }
    }
    if (!ftpClient->Login(pFtp->user, pFtp->pass)) {
        return -2;
    }
    return 0;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x10, %rsp
movq %rsi, %r14
movq %rdi, %rbx
cmpb $0x0, 0x12865(%rip)     # 0x18540
jne 0x5d2b
movq %rsp, %r15
movq %r15, %rdi
xorl %esi, %esi
callq 0x4640
movl 0x8(%r15), %edi
callq 0x43a0
movb $0x1, 0x12846(%rip)     # 0x18540
jmp 0x5d2b
callq 0x40d0
movl %eax, %ecx
imulq $0x8421085, %rcx, %rcx  # imm = 0x8421085
shrq $0x20, %rcx
movl %eax, %edx
subl %ecx, %edx
shrl %edx
addl %ecx, %edx
shrl $0x4, %edx
movl %edx, %ecx
shll $0x5, %ecx
subl %ecx, %edx
leal (%rax,%rdx), %edi
addl $0x2, %edi
callq 0x42b0
movq (%r14), %rsi
movq %rbx, %rdi
callq 0xe8f4
testl %eax, %eax
je 0x5cfc
movq 0x8(%r14), %rsi
movq 0x10(%r14), %rdx
movq %rbx, %rdi
callq 0xecf8
xorl %ecx, %ecx
testl %eax, %eax
setne %cl
leal -0x2(,%rcx,2), %eax
addq $0x10, %rsp
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O1/lianxings[P]ftp_benchmark/ftp_benchmark.cc
// Function: get_task_from_queue(task<fileInfo>&)
static int get_task_from_queue (task<fileInfo>& curTask)
{
    std::unique_lock<std::mutex> lock(tasksMutex);
    while ((tasksQueue.empty()) && (!exitFlag)) {
        tasksExecuteCV.wait(lock);
    }
    if (!tasksQueue.empty()) {
        curTask = tasksQueue.front();
        tasksQueue.pop();
        tasksProductCV.notify_one();
    } else {
        return -1;
    }
    return 0;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x10, %rsp
movq %rdi, %rbx
leaq 0x126db(%rip), %rax     # 0x18450
movq %rsp, %r14
movq %rax, (%r14)
movb $0x0, 0x8(%r14)
movq %r14, %rdi
callq 0xc30e
movb $0x1, 0x8(%r14)
movq 0x1269c(%rip), %rax     # 0x18430
cmpq 0x12675(%rip), %rax     # 0x18410
jne 0x5dcc
leaq 0x12704(%rip), %r14     # 0x184a8
movq %rsp, %r15
movl 0x12743(%rip), %eax     # 0x184f0
testl %eax, %eax
jne 0x5dcc
movq %r14, %rdi
movq %r15, %rsi
callq 0x4100
movq 0x1266d(%rip), %rax     # 0x18430
cmpq 0x12646(%rip), %rax     # 0x18410
je 0x5da7
movq 0x1263d(%rip), %r14     # 0x18410
cmpq %r14, 0x12656(%rip)     # 0x18430
je 0x5e20
movq %rbx, %rdi
movq %r14, %rsi
callq 0x4200
movq 0x20(%r14), %rax
movq %rax, 0x20(%rbx)
leaq 0x28(%rbx), %rdi
leaq 0x28(%r14), %rsi
callq 0x4200
movq 0x48(%r14), %rax
movq %rax, 0x48(%rbx)
leaq 0x125f5(%rip), %rdi     # 0x18400
callq 0xc34a
leaq 0x12661(%rip), %rdi     # 0x18478
callq 0x41d0
xorl %ebx, %ebx
jmp 0x5e25
movl $0xffffffff, %ebx       # imm = 0xFFFFFFFF
movq %rsp, %rdi
callq 0xc2f8
movl %ebx, %eax
addq $0x10, %rsp
popq %rbx
popq %r14
popq %r15
retq
movq %rax, %rbx
movq %rsp, %rdi
callq 0xc2f8
movq %rbx, %rdi
callq 0x46f0
// File: /workspace/github_cpp_makefile_star2_O1/lianxings[P]ftp_benchmark/ftp_benchmark.cc
// Function: build_ftp_data_connection(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, ftplib::accesstype, ftplib::transfermode, ftplib*, ftpInfo*, ftphandle**)
static int build_ftp_data_connection (string accessPath, ftplib::accesstype type, 
                                            ftplib::transfermode mode, ftplib* ftpClient,
                                            ftpInfo* pFtp, ftphandle** nData) 
{
    int retry = 0;
    while (retry < 5) {
        retry++;
        if (!ftpClient->FtpAccess(accessPath.c_str(), type, mode, ftpClient->mp_ftphandle, nData)) {
            if (ftpClient->mp_ftphandle->handle > 0) 
                net_close(ftpClient->mp_ftphandle->handle);
            int ret = connect_and_login_ftp (ftpClient, pFtp, 0);
            if (ret == -2) {  // login failed
                return ret;
            }
        } else {
            return 0;   // get ftp data connection succeed
        }
    }
    return -1;  // retry 5 times but failed
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %r9, %rbx
movq %r8, (%rsp)
movq %rcx, %r15
movl %edx, %ebp
movl %esi, %r12d
movq %rdi, %r13
movl $0x6, %r14d
decl %r14d
je 0x5eb6
movq (%r13), %rsi
movq (%r15), %r8
movq %r15, %rdi
movl %r12d, %edx
movl %ebp, %ecx
movq %rbx, %r9
callq 0xefd2
testl %eax, %eax
jne 0x5ebd
movq (%r15), %rax
movl 0x10(%rax), %edi
testl %edi, %edi
jle 0x5e9e
callq 0x4770
movq %r15, %rdi
movq (%rsp), %rsi
callq 0x5cc5
cmpl $-0x2, %eax
jne 0x5e6f
movl $0xfffffffe, %eax       # imm = 0xFFFFFFFE
jmp 0x5ebf
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
jmp 0x5ebf
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/lianxings[P]ftp_benchmark/ftp_benchmark.cc
// Function: usage(char*)
static void usage(char * cmd)
{
    printf("ftp benchmark tool.\n");
    printf("Usage: %s -n <ftp server> -u <user name> -p <password> -s <source path>  -d <destination path> -i\n", cmd);
    printf("options:\n");	
    printf("    -t     # the number of threads\n");
    printf("    -i     # verbose, show ftp messages\n");
    printf("    -v     # verify data correctness\n");
    printf("    -h     # show usage\n");
    printf("Example:\n");
    printf("    %s -n 10.1.1.1:21 -u user -p pass -s local:/home -d ftp:/dir -t 8                 # upload local directory to ftp server\n", cmd);
    printf("    %s -n 10.1.1.1 -u user -p pass -s null -d ftp:/dir -w 3 -l 3 -f 10 -S 64K:1M -t 8 # upload random files to  ftp directory\n", cmd);
    printf("    %s -n 10.1.1.1 -u user -p pass -s ftp:/dir -d local:/home -t 8                    # download files from ftp server to local directory\n", cmd);
    printf("    %s -n ftp.boss.xiaoyun -u user -p pass -s ftp:/dir  -d null -t 16                 # download files from ftp server to /dev/null\n\n", cmd);
    return;
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
leaq 0x7655(%rip), %rdi      # 0x132f4
callq 0x45e0
leaq 0x7350(%rip), %rdi      # 0x12ffb
movq %rbx, %rsi
xorl %eax, %eax
callq 0x4060
leaq 0x764c(%rip), %rdi      # 0x13308
callq 0x45e0
leaq 0x7649(%rip), %rdi      # 0x13311
callq 0x45e0
leaq 0x7660(%rip), %rdi      # 0x13334
callq 0x45e0
leaq 0x767c(%rip), %rdi      # 0x1335c
callq 0x45e0
leaq 0x7695(%rip), %rdi      # 0x13381
callq 0x45e0
leaq 0x76a1(%rip), %rdi      # 0x13399
callq 0x45e0
leaq 0x735a(%rip), %rdi      # 0x1305e
movq %rbx, %rsi
xorl %eax, %eax
callq 0x4060
leaq 0x73c7(%rip), %rdi      # 0x130dc
movq %rbx, %rsi
xorl %eax, %eax
callq 0x4060
leaq 0x7435(%rip), %rdi      # 0x1315b
movq %rbx, %rsi
xorl %eax, %eax
callq 0x4060
leaq 0x74af(%rip), %rdi      # 0x131e6
movq %rbx, %rsi
xorl %eax, %eax
popq %rbx
jmp 0x4060
// File: /workspace/github_cpp_makefile_star2_O1/lianxings[P]ftp_benchmark/ftp_benchmark.cc
// Function: put_task_to_queue(task<fileInfo>&)
static int put_task_to_queue (task<fileInfo>& curTask) 
{
    std::unique_lock<std::mutex> lock(tasksMutex);
    while ((tasksQueue.size() >= maxQueueSize) && (liveWorkThread > 0)) {
        tasksProductCV.wait(lock);
    }
    if (liveWorkThread > 0) {
        tasksQueue.push(curTask);
        tasksExecuteCV.notify_one();
    } else {
        return -1;
    }
    return 0;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rdi, %rbx
leaq 0xc6f9(%rip), %rax      # 0x18450
leaq 0x8(%rsp), %r14
movq %rax, (%r14)
movb $0x0, 0x8(%r14)
movq %r14, %rdi
callq 0xc30e
movb $0x1, 0x8(%r14)
movabsq $-0x3333333333333333, %r12 # imm = 0xCCCCCCCCCCCCCCCD
leaq 0xc6f6(%rip), %r15      # 0x18478
movq 0xc6bf(%rip), %rax      # 0x18448
movq %rax, %rcx
subq 0xc695(%rip), %rcx      # 0x18428
sarq $0x3, %rcx
cmpq $0x1, %rax
adcq $-0x1, %rcx
leaq (%rcx,%rcx,2), %rax
movq 0xc686(%rip), %rcx      # 0x18430
subq 0xc687(%rip), %rcx      # 0x18438
sarq $0x4, %rcx
imulq %r12, %rcx
leaq (%rcx,%rax,2), %rax
movq 0xc65c(%rip), %rcx      # 0x18420
subq 0xc645(%rip), %rcx      # 0x18410
sarq $0x4, %rcx
imulq %r12, %rcx
addq %rax, %rcx
cmpq $0x4000, %rcx           # imm = 0x4000
jb 0xbdf6
movl 0xc713(%rip), %eax      # 0x184f8
testl %eax, %eax
jle 0xbdf6
movq %r15, %rdi
movq %r14, %rsi
callq 0x4100
jmp 0xbd82
movl 0xc6fc(%rip), %eax      # 0x184f8
testl %eax, %eax
jle 0xbe1f
leaq 0xc5f9(%rip), %rdi      # 0x18400
movq %rbx, %rsi
callq 0xc8e0
leaq 0xc692(%rip), %rdi      # 0x184a8
callq 0x41d0
xorl %ebx, %ebx
jmp 0xbe24
movl $0xffffffff, %ebx       # imm = 0xFFFFFFFF
leaq 0x8(%rsp), %rdi
callq 0xc2f8
movl %ebx, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
movq %rax, %rbx
leaq 0x8(%rsp), %rdi
callq 0xc2f8
movq %rbx, %rdi
callq 0x46f0
nop
// File: /workspace/github_cpp_makefile_star2_O1/lianxings[P]ftp_benchmark/ftptest_utils.cc
// Function: size_to_string(unsigned long, char*)
void size_to_string(uint64_t size, char * buf)
{   
    uint64_t  multiplier = exbibytes;
    int i;

    for (i = 0; i < DIM(sizes); i++, multiplier /= 1024) {   
        if (size < multiplier)
            continue;
        if (size % multiplier == 0)
            sprintf(buf, "%llu %s", (unsigned long long)size / multiplier, sizes[i]);
        else
            sprintf(buf, "%.1f %s", (float) size / multiplier, sizes[i]);
        return ;
    }
    strcpy(buf, "0");
    return ;
}

// Assembly:
movabsq $0x1000000000000000, %r8 # imm = 0x1000000000000000
xorl %ecx, %ecx
cmpq %rdi, %r8
jbe 0xdcc6
shrq $0xa, %r8
addq $0x8, %rcx
cmpl $0x38, %ecx
jne 0xdcae
movw $0x30, (%rsi)
retq
leaq -0x1(%r8), %rax
testq %rdi, %rax
je 0xdcdb
testq %rdi, %rdi
js 0xdd05
cvtsi2ss %rdi, %xmm0
jmp 0xdd1a
movq %rdi, %rax
xorl %edx, %edx
divq %r8
leaq 0xa066(%rip), %rdx      # 0x17d50
movq (%rcx,%rdx), %rcx
leaq 0x5943(%rip), %rdx      # 0x13638
movq %rsi, %rdi
movq %rdx, %rsi
movq %rax, %rdx
xorl %eax, %eax
jmp 0x40a0
movq %rdi, %rax
shrq %rax
andl $0x1, %edi
orq %rax, %rdi
cvtsi2ss %rdi, %xmm0
addss %xmm0, %xmm0
cvtsi2ss %r8, %xmm1
divss %xmm1, %xmm0
cvtss2sd %xmm0, %xmm0
leaq 0xa022(%rip), %rax      # 0x17d50
movq (%rcx,%rax), %rdx
leaq 0x5907(%rip), %rax      # 0x13640
movq %rsi, %rdi
movq %rax, %rsi
movb $0x1, %al
jmp 0x40a0
// File: /workspace/github_cpp_makefile_star2_O1/lianxings[P]ftp_benchmark/ftptest_utils.cc
// Function: string_to_size(char const*)
int64_t string_to_size(const char * str)
{
    char c;
    int64_t num;
    int64_t ret;
    int64_t mult;
    char buf[32];

    strcpy(buf, str);
    
    c = buf[strlen(buf) - 1];
    if (c > '9') {
        buf[strlen(buf) - 1] = '\0';
    }
    double f = atof(buf);
    num = atoll(buf);

    if(isdigit(c))
        return num;
    
    switch(c) {
    case 't':
    case 'T':
        mult = 0x1ULL << 40; //1024 * 1024 * 1024*1024;
	break;
    case 'g':
    case 'G':
        mult = 0x1ULL << 30; //1024 * 1024 * 1024;
	break;
    case 'm':
    case 'M':
        mult = 0x1ULL << 20;//1024 * 1024;
	break;
    case 'k':
    case 'K':
        mult = 0x1ULL << 10;//1024;
	break;
    case 'b':
    case 'B':
        mult = 1;
	break;
    default:
        return -1;
    }

    ret = mult * f;
    return ret;
}

// Assembly:
pushq %rbx
subq $0x20, %rsp
movq %rdi, %rsi
movq %rsp, %rbx
movq %rbx, %rdi
callq 0x4380
movq %rbx, %rdi
callq 0x4180
movsbl -0x1(%rax,%rbx), %ebx
cmpl $0x3a, %ebx
jl 0xdd70
movb $0x0, -0x1(%rsp,%rax)
movq %rsp, %rdi
callq 0x44d0
leal -0x30(%rbx), %eax
cmpl $0x9, %eax
ja 0xdd8d
movq %rsp, %rdi
callq 0x42e0
jmp 0xde15
movzbl %bl, %ecx
movsd 0x5878(%rip), %xmm1     # 0x13610
movq $-0x1, %rax
cmpl $0x61, %ecx
jg 0xddba
cmpl $0x4a, %ecx
jle 0xddd0
cmpl $0x4b, %ecx
je 0xddfa
cmpl $0x4d, %ecx
je 0xde04
cmpl $0x54, %ecx
je 0xde0c
jmp 0xde15
cmpl $0x6a, %ecx
jle 0xdddc
cmpl $0x6b, %ecx
je 0xddfa
cmpl $0x6d, %ecx
je 0xde04
cmpl $0x74, %ecx
je 0xde0c
jmp 0xde15
cmpl $0x42, %ecx
je 0xddf0
cmpl $0x47, %ecx
je 0xdde6
jmp 0xde15
cmpl $0x62, %ecx
je 0xddf0
cmpl $0x67, %ecx
jne 0xde15
movsd 0x5842(%rip), %xmm1     # 0x13630
jmp 0xde0c
movsd 0x5820(%rip), %xmm1     # 0x13618
jmp 0xde0c
movsd 0x581e(%rip), %xmm1     # 0x13620
jmp 0xde0c
movsd 0x581c(%rip), %xmm1     # 0x13628
mulsd %xmm1, %xmm0
cvttsd2si %xmm0, %rax
addq $0x20, %rsp
popq %rbx
retq
// File: /workspace/github_cpp_makefile_star2_O1/lianxings[P]ftp_benchmark/ftptest_utils.cc
// Function: normalize_dir_format(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 normalize_dir_format(string& localPath, string& ftpPath) 
{
    if (localPath.length() > 0 && localPath.at(localPath.size() - 1) != '/') {
        localPath.push_back('/');
    }

    if (ftpPath.length() > 0) {
        if (ftpPath.at(0) != '/') {
            ftpPath = "/" + ftpPath;
        }
        if (ftpPath.at(ftpPath.size() - 1) != '/') {
            ftpPath.push_back('/');
        }
    }
    return;
}

// Assembly:
pushq %r14
pushq %rbx
subq $0x28, %rsp
movq %rsi, %rbx
movq 0x8(%rdi), %rax
testq %rax, %rax
je 0xde42
movq (%rdi), %rcx
cmpb $0x2f, -0x1(%rcx,%rax)
je 0xde42
movl $0x2f, %esi
callq 0x4320
cmpq $0x0, 0x8(%rbx)
je 0xdeb0
movq (%rbx), %rax
cmpb $0x2f, (%rax)
je 0xde8d
leaq 0x4fdb(%rip), %rsi      # 0x12e33
leaq 0x8(%rsp), %r14
movq %r14, %rdi
movq %rbx, %rdx
callq 0xe138
movq %rbx, %rdi
movq %r14, %rsi
callq 0x44c0
movq (%r14), %rdi
leaq 0x18(%rsp), %rax
cmpq %rax, %rdi
je 0xde8d
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x4400
movq 0x8(%rbx), %rdx
movq %rdx, %rsi
subq $0x1, %rsi
jb 0xdeb8
movq (%rbx), %rax
cmpb $0x2f, (%rax,%rsi)
je 0xdeb0
movq %rbx, %rdi
movl $0x2f, %esi
callq 0x4320
addq $0x28, %rsp
popq %rbx
popq %r14
retq
leaq 0x53d7(%rip), %rdi      # 0x13296
xorl %eax, %eax
callq 0x45a0
// File: /workspace/github_cpp_makefile_star2_O1/lianxings[P]ftp_benchmark/ftptest_utils.cc
// Function: resolve_list_entry(char const*, 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 resolve_list_entry (const char * dataBuf, string& name, string& sizeStr) 
{
    if (dataBuf == NULL) return;
    int i = strlen(dataBuf) - 2;
    while (dataBuf[i] != ' ') {
        name = dataBuf[i] + name;
        --i;
    }
    int spaceNum = 0;
    while (spaceNum < 4) {
        if (dataBuf[i] == ' ')
            spaceNum++;
        --i;
    }
    while (dataBuf[i] != ' ') {
        sizeStr = dataBuf[i] + sizeStr;
        --i;
    }
}

// Assembly:
testq %rdi, %rdi
je 0xdfea
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rdx, %rbx
movq %rsi, %r12
movq %rdi, %r14
callq 0x4180
movq %rax, %r15
addl $-0x2, %r15d
movslq %r15d, %rcx
movb (%r14,%rcx), %al
cmpb $0x20, %al
movq %r14, (%rsp)
je 0xdf4e
leaq 0x18(%rsp), %rbp
addq %rcx, %r14
decq %r14
leaq 0x8(%rsp), %r13
movsbl %al, %esi
movq %r13, %rdi
movq %r12, %rdx
callq 0xe1c0
movq %r12, %rdi
movq %r13, %rsi
callq 0x44c0
movq 0x8(%rsp), %rdi
cmpq %rbp, %rdi
je 0xdf41
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x4400
movb (%r14), %al
decl %r15d
decq %r14
cmpb $0x20, %al
jne 0xdf11
movslq %r15d, %rax
movq (%rsp), %r8
leaq (%r8,%rax), %rcx
shlq $0x20, %rax
xorl %edx, %edx
movabsq $-0x100000000, %rsi     # imm = 0xFFFFFFFF00000000
decl %r15d
xorl %edi, %edi
cmpb $0x20, (%rcx)
sete %dil
addl %edi, %edx
decq %rcx
addq %rsi, %rax
cmpl $0x4, %edx
jb 0xdf69
sarq $0x20, %rax
movb (%r8,%rax), %al
cmpb $0x20, %al
je 0xdfdc
leaq 0x18(%rsp), %r12
movslq %r15d, %rcx
leaq (%r8,%rcx), %r15
decq %r15
leaq 0x8(%rsp), %r14
movsbl %al, %esi
movq %r14, %rdi
movq %rbx, %rdx
callq 0xe1c0
movq %rbx, %rdi
movq %r14, %rsi
callq 0x44c0
movq 0x8(%rsp), %rdi
cmpq %r12, %rdi
je 0xdfd2
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x4400
movb (%r15), %al
decq %r15
cmpb $0x20, %al
jne 0xdfa2
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/lianxings[P]ftp_benchmark/ftptest_utils.cc
// Function: resolve_base_name(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&)
string resolve_base_name (const string& srcPath) 
{
    int lastSlashLoc = 0;
    int slashLoc = 0;
    string baseName("");
    while ((slashLoc = srcPath.find('/', lastSlashLoc)) != std::string::npos) {
        if (slashLoc == srcPath.size() - 1) {
            baseName = srcPath.substr(lastSlashLoc, srcPath.size() - lastSlashLoc);
            break;
        }
        lastSlashLoc = slashLoc + 1;
    }
    
    if (baseName.empty()) {
        baseName = srcPath.substr(lastSlashLoc, srcPath.size() - lastSlashLoc);
    }
    return baseName;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x20, %rsp
movq %rsi, %r14
movq %rdi, %rbx
movabsq $-0x100000000, %r12     # imm = 0xFFFFFFFF00000000
leaq 0x10(%rdi), %r13
movq %r13, (%rdi)
leaq 0x48ec(%rip), %rdx      # 0x12902
movq %rdx, %rsi
callq 0xd47e
xorl %r15d, %r15d
movq %r14, %rdi
movl $0x2f, %esi
xorl %edx, %edx
callq 0x44f0
movq %rax, %rdx
shlq $0x20, %rdx
cmpq %r12, %rdx
je 0xe0c2
sarq $0x20, %rdx
movq 0x8(%r14), %rcx
leaq -0x1(%rcx), %rsi
cmpq %rsi, %rdx
jne 0xe056
xorl %r15d, %r15d
jmp 0xe088
incl %eax
movslq %eax, %r15
movq %r14, %rdi
movl $0x2f, %esi
movq %r15, %rdx
callq 0x44f0
movq %rax, %rdx
shlq $0x20, %rdx
cmpq %r12, %rdx
je 0xe0c2
sarq $0x20, %rdx
movq 0x8(%r14), %rcx
leaq -0x1(%rcx), %rsi
cmpq %rsi, %rdx
jne 0xe056
subq %r15, %rcx
movq %rsp, %rdi
movq %r14, %rsi
movq %r15, %rdx
callq 0x4410
movq %rsp, %r12
movq %rbx, %rdi
movq %r12, %rsi
callq 0x44c0
movq (%r12), %rdi
leaq 0x10(%rsp), %rax
cmpq %rax, %rdi
je 0xe0c2
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x4400
cmpq $0x0, 0x8(%rbx)
jne 0xe106
movq 0x8(%r14), %rcx
subq %r15, %rcx
movq %rsp, %rdi
movq %r14, %rsi
movq %r15, %rdx
callq 0x4410
movq %rsp, %r14
movq %rbx, %rdi
movq %r14, %rsi
callq 0x44c0
movq (%r14), %rdi
leaq 0x10(%rsp), %rax
cmpq %rax, %rdi
je 0xe106
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x4400
movq %rbx, %rax
addq $0x20, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
jmp 0xe119
movq %rax, %r14
movq (%rbx), %rdi
cmpq %r13, %rdi
je 0xe130
movq (%r13), %rsi
incq %rsi
callq 0x4400
movq %r14, %rdi
callq 0x46f0
// File: /workspace/github_cpp_makefile_star2_O1/lianxings[P]ftp_benchmark/ftplib.cc
// Function: ftplib::ftplib()
ftplib::ftplib()
{
    #if defined(_WIN32)
    WSADATA wsa;
    if (WSAStartup(MAKEWORD(1, 1), &wsa))
    {
         printf("WSAStartup() failed, %lu\n", (unsigned long)GetLastError());
    }
    #endif
                
	#ifndef NOSSL
	SSL_library_init();
	#endif	

	mp_ftphandle = static_cast<ftphandle *>(calloc(1,sizeof(ftphandle)));
	if (mp_ftphandle == NULL) perror("calloc");
	mp_ftphandle->buf = static_cast<char *>(malloc(FTPLIB_BUFSIZ));
	if (mp_ftphandle->buf == NULL)
	{
		perror("calloc");
		free(mp_ftphandle);
	}
	#ifndef NOSSL
	mp_ftphandle->ctx = SSL_CTX_new(_FTPLIB_SSL_CLIENT_METHOD_());
	SSL_CTX_set_verify(mp_ftphandle->ctx, SSL_VERIFY_NONE, NULL);
	mp_ftphandle->ssl = SSL_new(mp_ftphandle->ctx);
	#endif
	ClearHandle();
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
movl $0x1, %edi
movl $0x1c0, %esi            # imm = 0x1C0
callq 0x4240
movq %rax, (%rbx)
testq %rax, %rax
je 0xe2b9
movl $0x400, %edi            # imm = 0x400
callq 0x4500
movq (%rbx), %rcx
movq %rax, 0x20(%rcx)
testq %rax, %rax
je 0xe2c7
movq (%rbx), %rax
xorl %ecx, %ecx
movl %ecx, 0x28(%rax)
movq %rcx, 0x30(%rax)
movl $0x1, 0x38(%rax)
movq %rcx, 0x58(%rax)
movq $0x3c, 0x40(%rax)
movq %rcx, 0x1b0(%rax)
movl %ecx, 0x10(%rax)
movb $0x0, 0x1b8(%rax)
xorps %xmm0, %xmm0
movups %xmm0, 0x48(%rax)
movups %xmm0, 0x60(%rax)
movups %xmm0, 0x70(%rax)
movq %rcx, 0x80(%rax)
popq %rbx
retq
leaq 0x53b4(%rip), %rdi      # 0x13674
callq 0x4310
jmp 0xe25b
movq %rbx, %rdi
callq 0x4be2
jmp 0xe271
nop
// File: /workspace/github_cpp_makefile_star2_O1/lianxings[P]ftp_benchmark/ftplib.cc
// Function: ftplib::socket_wait(ftphandle*)
int ftplib::socket_wait(ftphandle *ctl)
{
	fd_set fd,*rfd = NULL,*wfd = NULL;
	struct timeval tv;
	int rv = 0;

	if (ctl->idlecb == NULL) return 1;

	/*if ((ctl->dir == FTPLIB_CONTROL)
		|| (ctl->idlecb == NULL)
		|| ((ctl->idletime.tv_sec == 0)
		&& //(ctl->idletime.tv_usec 0))
	return 1;*/

	if (ctl->dir == FTPLIB_WRITE) wfd = &fd;
	else rfd = &fd;

	FD_ZERO(&fd);
	do
	{
		FD_SET(ctl->handle,&fd);
		tv = ctl->idletime;
		rv = select(ctl->handle+1, rfd, wfd, NULL, &tv);
		if (rv == -1)
		{
			rv = 0;
			strncpy(ctl->ctrl->response, strerror(errno), sizeof(ctl->ctrl->response));
			break;
		}
		else if (rv > 0)
		{
			rv = 1;
			break;
		}
	} while ((rv = ctl->idlecb(ctl->cbarg)));

	return rv;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x98, %rsp
movl $0x1, %ebx
cmpq $0x0, 0x58(%rsi)
je 0xe430
movq %rsi, %r14
xorl %eax, %eax
cmpl $0x2, 0x28(%rsi)
leaq 0x10(%rsp), %r15
movq %r15, %r12
cmoveq %rax, %r12
xorps %xmm0, %xmm0
movaps %xmm0, 0x70(%r15)
movaps %xmm0, 0x60(%r15)
movaps %xmm0, 0x50(%r15)
movaps %xmm0, 0x40(%r15)
movaps %xmm0, 0x30(%r15)
movaps %xmm0, 0x20(%r15)
movaps %xmm0, 0x10(%r15)
movaps %xmm0, (%r15)
cmovneq %rax, %r15
leaq 0x40(%rsi), %rbp
movq %rsp, %r13
movl 0x10(%r14), %edi
leal 0x3f(%rdi), %eax
testl %edi, %edi
cmovnsl %edi, %eax
movl %eax, %edx
andl $-0x40, %edx
movl %edi, %ecx
subl %edx, %ecx
movl $0x1, %edx
shlq %cl, %rdx
sarl $0x6, %eax
cltq
orq %rdx, 0x10(%rsp,%rax,8)
movups (%rbp), %xmm0
movaps %xmm0, (%rsp)
incl %edi
movq %r12, %rsi
movq %r15, %rdx
xorl %ecx, %ecx
movq %r13, %r8
callq 0x4390
cmpl $-0x1, %eax
je 0xe409
testl %eax, %eax
jg 0xe430
movq 0x68(%r14), %rdi
callq *0x58(%r14)
testl %eax, %eax
jne 0xe3b1
jmp 0xe42e
movl $0x88, %ebx
addq 0x30(%r14), %rbx
callq 0x4050
movl (%rax), %edi
callq 0x4130
movl $0x100, %edx            # imm = 0x100
movq %rbx, %rdi
movq %rax, %rsi
callq 0x41e0
xorl %ebx, %ebx
movl %ebx, %eax
addq $0x98, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/lianxings[P]ftp_benchmark/ftplib.cc
// Function: ftplib::readresp(char, ftphandle*)
int ftplib::readresp(char c, ftphandle *nControl)
{
	char match[5];
	
	if (readline(nControl->response,256,nControl) == -1)
	{
	    std::cerr << "Control socket "<< nControl->handle << " read failed: " << nControl->response << std::endl;
		return 0;
	}
	
	if (nControl->response[3] == '-')
	{
		strncpy(match,nControl->response,3);
		match[3] = ' ';
		match[4] = '\0';
		do
		{
			if (readline(nControl->response,256,nControl) == -1)
			{
                std::cerr << "Control socket "<< nControl->handle << " read failed: " 
                          << nControl->response << ", " << match << std::endl;
				return 0;
			}
		} while (strncmp(nControl->response,match,4));
	}

    if (nControl->response[0] == c) 
        return 1;

    return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x10, %rsp
movq %rdx, %r14
movl %esi, %ebp
movq %rdi, %r15
leaq 0x88(%rdx), %rbx
movq %rbx, %rsi
movl $0x100, %edx            # imm = 0x100
movq %r14, %rcx
callq 0xe444
cmpl $-0x1, %eax
je 0xe7dc
cmpb $0x2d, 0x8b(%r14)
jne 0xe7cf
leaq 0xb(%rsp), %r12
movl $0x3, %edx
movq %r12, %rdi
movq %rbx, %rsi
callq 0x41e0
movw $0x20, 0x3(%r12)
movq %r15, %rdi
movq %rbx, %rsi
movl $0x100, %edx            # imm = 0x100
movq %r14, %rcx
callq 0xe444
cmpl $-0x1, %eax
je 0xe81c
movl $0x4, %edx
movq %rbx, %rdi
movq %r12, %rsi
callq 0x41b0
testl %eax, %eax
jne 0xe7a3
xorl %eax, %eax
cmpb %bpl, (%rbx)
sete %al
jmp 0xe8c8
movq 0x980d(%rip), %r15      # 0x17ff0
leaq 0x4f2a(%rip), %rsi      # 0x13714
movl $0xf, %edx
movq %r15, %rdi
callq 0x4460
movl 0x10(%r14), %esi
movq %r15, %rdi
callq 0x46c0
movq %rax, %r14
leaq 0x4f17(%rip), %rsi      # 0x13724
movl $0xe, %edx
movq %rax, %rdi
callq 0x4460
jmp 0xe889
movq 0x97cd(%rip), %r15      # 0x17ff0
leaq 0x4eea(%rip), %rsi      # 0x13714
movl $0xf, %edx
movq %r15, %rdi
callq 0x4460
movl 0x10(%r14), %esi
movq %r15, %rdi
callq 0x46c0
movq %rax, %r14
leaq 0x4ed7(%rip), %rsi      # 0x13724
movl $0xe, %edx
movq %rax, %rdi
callq 0x4460
movq %rbx, %rdi
callq 0x4180
movq %r14, %rdi
movq %rbx, %rsi
movq %rax, %rdx
callq 0x4460
leaq 0x4ebc(%rip), %rsi      # 0x13733
movl $0x2, %edx
movq %r14, %rdi
callq 0x4460
leaq 0xb(%rsp), %rbx
movq %rbx, %rdi
callq 0x4180
movq %r14, %rdi
movq %rbx, %rsi
movq %rax, %rdx
callq 0x4460
movq (%r14), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x43b0
movsbl %al, %esi
movq %r14, %rdi
callq 0x4040
movq %rax, %rdi
callq 0x4260
xorl %eax, %eax
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
nop