LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_cpp_makefile_star2_O2/Thilotilo[P]DoaERando/NPCManipulator.cpp
// Function: DoaERando::NPCManipulator::ReplacePangTong(unsigned char)
void NPCManipulator::ReplacePangTong(BYTE generalId)
{
    // Set the flags for the new general after the "Pang Tong went out
    // with his soldiers" Text
    myRom.WriteByte(0x36EAF, generalId);
    // Read the new general's recruitment flags, which are used to determine
    // whether to launch the battle.
    myRom.WriteByte(0x3B3C5, generalId);
    // Actual replacement for who joined our army after the battle
    myRom.WriteByte(0x36ECC, generalId);
    // Text replace for Pang Tong went out with his soldiers
    myRom.WriteByte(0x2EA09, generalId);
    // Text replace for Pang Tong joined our army
    myRom.WriteByte(0x2EA62, generalId);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
movl %esi, %ebx
movq %rdi, %r14
movq (%rdi), %rdi
movl $0x36eaf, %esi          # imm = 0x36EAF
movl %ebx, %edx
callq 0x404a00
movq (%r14), %rdi
movl $0x3b3c5, %esi          # imm = 0x3B3C5
movl %ebx, %edx
callq 0x404a00
movq (%r14), %rdi
movl $0x36ecc, %esi          # imm = 0x36ECC
movl %ebx, %edx
callq 0x404a00
movq (%r14), %rdi
movl $0x2ea09, %esi          # imm = 0x2EA09
movl %ebx, %edx
callq 0x404a00
movq (%r14), %rdi
movl $0x2ea62, %esi          # imm = 0x2EA62
movl %ebx, %edx
popq %rbx
popq %r14
popq %rbp
jmp 0x404a00
nop
// File: /workspace/github_cpp_makefile_star2_O2/Thilotilo[P]DoaERando/NPCManipulator.cpp
// Function: DoaERando::NPCManipulator::ReplaceXuZheBridgeTrigger(unsigned char)
void NPCManipulator::ReplaceXuZheBridgeTrigger(BYTE generalId)
{
    // Replace the general that the bridge lady looks for
    myRom.WriteByte(0x3684F, generalId);

    // Xu Zhe, my love, where are you?
    myRom.WriteByte(0x2AF53, generalId); // Replace Id
    myRom.WriteByte(0x2AF55, 0xE0); // newline in case of long name

    // Xu Zhe!  Oh, I'm blocking the bridge...
    myRom.WriteByte(0x2AF65, generalId); // Replace ID
    // Adjust text to protect against long names.
    myRom.WriteByte(0x2AF67, 0xFB);
    myRom.WriteByte(0x2AF68, 0x18);
    myRom.WriteByte(0x2AF69, 0x0A);
    myRom.WriteByte(0x2AF6A, 0x30);
    myRom.WriteByte(0x2AF6B, 0x3C);
    myRom.WriteByte(0x2AF6C, 0x8E);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
movl %esi, %r14d
movq %rdi, %rbx
movq (%rdi), %rdi
movl $0x3684f, %esi          # imm = 0x3684F
movl %r14d, %edx
callq 0x404a00
movq (%rbx), %rdi
movl $0x2af53, %esi          # imm = 0x2AF53
movl %r14d, %edx
callq 0x404a00
movq (%rbx), %rdi
movl $0x2af55, %esi          # imm = 0x2AF55
movl $0xe0, %edx
callq 0x404a00
movq (%rbx), %rdi
movl $0x2af65, %esi          # imm = 0x2AF65
movl %r14d, %edx
callq 0x404a00
movq (%rbx), %rdi
movl $0x2af67, %esi          # imm = 0x2AF67
movl $0xfb, %edx
callq 0x404a00
movq (%rbx), %rdi
pushq $0x18
popq %rdx
movl $0x2af68, %esi          # imm = 0x2AF68
callq 0x404a00
movq (%rbx), %rdi
pushq $0xa
popq %rdx
movl $0x2af69, %esi          # imm = 0x2AF69
callq 0x404a00
movq (%rbx), %rdi
pushq $0x30
popq %rdx
movl $0x2af6a, %esi          # imm = 0x2AF6A
callq 0x404a00
movq (%rbx), %rdi
pushq $0x3c
popq %rdx
movl $0x2af6b, %esi          # imm = 0x2AF6B
callq 0x404a00
movq (%rbx), %rdi
movl $0x2af6c, %esi          # imm = 0x2AF6C
movl $0x8e, %edx
popq %rbx
popq %r14
popq %rbp
jmp 0x404a00
nop
// File: /workspace/github_cpp_makefile_star2_O2/Thilotilo[P]DoaERando/NPCManipulator.cpp
// Function: DoaERando::NPCManipulator::ReplaceMaYuanyi(unsigned char)
void NPCManipulator::ReplaceMaYuanyi(BYTE generalId)
{
    // Replace the actual NPC
    myRom.WriteByte(0x31A73, generalId);
    // This requires a bit of explanation.  There are 2 bits that can tell the NPC to
    // use text 2 instead of text 1.  One of those bits is set when the yellow scarves
    // are defeated, the other is set when Ma Yuanyi is defeated.  It doesn't matter
    // if one or both are set - as long as both aren't clear, we will move to text 2.
    // EXCEPT we can actually move one id past text 2 if both bits are set AND bit 6 of
    // the YZone is set.  Thus, we swizzle this a bit so that both of Ma Yuanyi's texts
    // are the battle text (the textId + 1 is the text we get on future interactions), and
    // then set both bits when the battle is complete.  This way, we can't lock the battle
    // out when we clear the yellow scarves.  (Note that this will go ahead and change the
    // other NPCs in Qing Zhou texts, but those aren't really relevant any more anyway)
    myRom.WriteByte(0x31A6E, 0xCB); // Set bit 6 of YZone
    myRom.WriteByte(0x31A72, 0xAB); // Set text 2 to the battle text
    myRom.WriteByte(0x3B076, 0x83); // Set bit 7 & bit 0 of the location flags
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
movl %esi, %edx
movq %rdi, %rbx
movq (%rdi), %rdi
movl $0x31a73, %esi          # imm = 0x31A73
callq 0x404a00
movq (%rbx), %rdi
movl $0x31a6e, %esi          # imm = 0x31A6E
movl $0xcb, %edx
callq 0x404a00
movq (%rbx), %rdi
movl $0x31a72, %esi          # imm = 0x31A72
movl $0xab, %edx
callq 0x404a00
movq (%rbx), %rdi
movl $0x3b076, %esi          # imm = 0x3B076
movl $0x83, %edx
addq $0x8, %rsp
popq %rbx
popq %rbp
jmp 0x404a00
// File: /workspace/github_cpp_makefile_star2_O2/Thilotilo[P]DoaERando/NPCManipulator.cpp
// Function: DoaERando::NPCManipulator::ReplaceYuanShang(unsigned char)
void NPCManipulator::ReplaceYuanShang(BYTE generalId)
{
    // Replace the actual NPC
    myRom.WriteByte(0x317C3, generalId);
    myRom.WriteByte(0x3695A, generalId);
    // Set the correct general's flags to 0x90 (recruitable & encounterable)
    // rather than setting Yuan Shang's flags to 00 after defeating the
    // Yuan Shang battle.
    myRom.WriteByte(0x3693A, 0x90);
    myRom.WriteByte(0x3693C, generalId);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
movl %esi, %ebx
movq %rdi, %r14
movq (%rdi), %rdi
movl $0x317c3, %esi          # imm = 0x317C3
movl %ebx, %edx
callq 0x404a00
movq (%r14), %rdi
movl $0x3695a, %esi          # imm = 0x3695A
movl %ebx, %edx
callq 0x404a00
movq (%r14), %rdi
movl $0x3693a, %esi          # imm = 0x3693A
movl $0x90, %edx
callq 0x404a00
movq (%r14), %rdi
movl $0x3693c, %esi          # imm = 0x3693C
movl %ebx, %edx
popq %rbx
popq %r14
popq %rbp
jmp 0x404a00
nop
// File: /workspace/github_cpp_makefile_star2_O2/saumya-prakash[P]AssemblerEmulator/asm.cpp
// Function: main
int main(int argc, char **argv)
{
    if(argc==1)
    {
        cout<<"Fatal Error: No input file specified."<<endl;
        exit(EXIT_FAILURE);
    }

    ifstream src;

    src.open(argv[1], ofstream::in);

    if(!src)
    {
        cout<<"Error in opening file"<<endl;
        exit(EXIT_FAILURE);
    }

    Assembler a1(src, argv[1]);

    a1.assemble();
    a1.generate_listing_file();
    a1.generate_log_file();

    if(a1.get_assembly_status()==false)
    {   
        cout<<endl<<"Errors: "<<endl;
        a1.print_errors(cout);
        cout<<endl;
    }

    if(a1.get_assembly_status()==true)
    {
        cout<<"Assembled successfully"<<endl;
        cout<<endl;
    }


    if(a1.get_warning_status()==true)
    {
        cout<<endl<<"Warnings: "<<endl;
        a1.print_warnings(cout);
        cout<<endl;
    }


    src.close();
    

    exit(EXIT_SUCCESS);
}

// Assembly:
pushq %r14
pushq %rbx
subq $0x368, %rsp            # imm = 0x368
cmpl $0x1, %edi
jne 0x2bee
movq 0x9406(%rip), %rdi      # 0xbfd8
leaq 0x542b(%rip), %rsi      # 0x8004
callq 0x21b0
movq %rax, %rdi
callq 0x2100
pushq $0x1
popq %rdi
callq 0x2230
movq %rsi, %rbx
leaq 0x160(%rsp), %r14
movq %r14, %rdi
callq 0x2200
movq 0x8(%rbx), %rsi
pushq $0x8
popq %rdx
movq %r14, %rdi
callq 0x2130
movq 0x160(%rsp), %rax
movq -0x18(%rax), %rax
testb $0x5, 0x180(%rsp,%rax)
jne 0x2d14
movq 0x8(%rbx), %rsi
leaq 0x10(%rsp), %rdi
leaq 0xf(%rsp), %rdx
callq 0x2db8
leaq 0x30(%rsp), %rdi
leaq 0x160(%rsp), %rsi
leaq 0x10(%rsp), %rdx
callq 0x2df4
leaq 0x10(%rsp), %rdi
callq 0x20e0
leaq 0x30(%rsp), %rdi
callq 0x3350
leaq 0x30(%rsp), %rdi
callq 0x4e24
leaq 0x30(%rsp), %rdi
callq 0x53a0
movb 0x158(%rsp), %al
testb %al, %al
je 0x2d34
testb $0x1, %al
je 0x2cb6
movq 0x9342(%rip), %rdi      # 0xbfd8
leaq 0x53ac(%rip), %rsi      # 0x8049
callq 0x21b0
movq %rax, %rdi
callq 0x2100
movq 0x9327(%rip), %rdi      # 0xbfd8
callq 0x2100
cmpb $0x1, 0x159(%rsp)
jne 0x2d00
movq 0x9311(%rip), %rdi      # 0xbfd8
callq 0x2100
leaq 0x538d(%rip), %rsi      # 0x8060
movq %rax, %rdi
callq 0x21b0
movq %rax, %rdi
callq 0x2100
movq 0x92ee(%rip), %rsi      # 0xbfd8
leaq 0x30(%rsp), %rdi
callq 0x58cc
movq 0x92dd(%rip), %rdi      # 0xbfd8
callq 0x2100
leaq 0x160(%rsp), %rdi
callq 0x2070
xorl %edi, %edi
callq 0x2230
movq 0x92bd(%rip), %rdi      # 0xbfd8
leaq 0x5308(%rip), %rsi      # 0x802a
callq 0x21b0
movq %rax, %rdi
callq 0x2100
jmp 0x2be6
movq 0x929d(%rip), %rdi      # 0xbfd8
callq 0x2100
leaq 0x52f9(%rip), %rsi      # 0x8040
movq %rax, %rdi
callq 0x21b0
movq %rax, %rdi
callq 0x2100
movq 0x927a(%rip), %rsi      # 0xbfd8
leaq 0x30(%rsp), %rdi
callq 0x5754
movq 0x9269(%rip), %rdi      # 0xbfd8
callq 0x2100
movb 0x158(%rsp), %al
jmp 0x2c8b
movq %rax, %rbx
leaq 0x30(%rsp), %rdi
callq 0x2f24
jmp 0x2da3
movq %rax, %rbx
leaq 0x10(%rsp), %rdi
callq 0x20e0
jmp 0x2da3
jmp 0x2da0
movq %rax, %rbx
leaq 0x160(%rsp), %rdi
callq 0x2080
movq %rbx, %rdi
callq 0x2310
// File: /workspace/github_cpp_makefile_star2_O2/saumya-prakash[P]AssemblerEmulator/Assembler.cpp
// Function: Assembler::str_to_int(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>&) const
int Assembler::str_to_int(string &num) const
{
    istringstream iss(num);

    int a = 0;

    string::iterator it=num.begin();
    
    if(*it=='+' || *it=='-')
        ++it;
    

    if(*it=='0')    // oct or hex
    {
        ++it;

        if(it==num.end())
            return 0;

        if(*it=='x' || *it=='X')
            iss>>hex>>a;
            

        else
            iss>>oct>>a;
        
    }

    else        // normal decimal
        iss>>a;


    iss>>dec;
    return a;
}

// Assembly:
pushq %r14
pushq %rbx
subq $0x188, %rsp            # imm = 0x188
movq %rsi, %r14
leaq 0x8(%rsp), %rdi
pushq $0x8
popq %rbx
movl %ebx, %edx
callq 0x2300
andl $0x0, 0x4(%rsp)
movq (%r14), %rax
movzbl (%rax), %edx
cmpl $0x2d, %edx
je 0x32bc
movq %rax, %rcx
cmpl $0x2b, %edx
jne 0x32c3
leaq 0x1(%rax), %rcx
movb 0x1(%rax), %dl
cmpb $0x30, %dl
jne 0x32f6
incq %rcx
addq 0x8(%r14), %rax
cmpq %rax, %rcx
je 0x3337
movb (%rcx), %al
addb $-0x58, %al
testb $-0x21, %al
pushq $0x40
popq %rax
cmovel %ebx, %eax
movq 0x8(%rsp), %rcx
movq -0x18(%rcx), %rcx
movl 0x20(%rsp,%rcx), %edx
andl $-0x4b, %edx
orl %eax, %edx
movl %edx, 0x20(%rsp,%rcx)
leaq 0x8(%rsp), %rdi
leaq 0x4(%rsp), %rsi
callq 0x2120
movq 0x8(%rsp), %rax
movq -0x18(%rax), %rax
movl 0x20(%rsp,%rax), %ecx
andl $-0x4b, %ecx
orl $0x2, %ecx
movl %ecx, 0x20(%rsp,%rax)
movl 0x4(%rsp), %ebx
leaq 0x8(%rsp), %rdi
callq 0x20f0
movl %ebx, %eax
addq $0x188, %rsp            # imm = 0x188
popq %rbx
popq %r14
retq
xorl %ebx, %ebx
jmp 0x3320
movq %rax, %rbx
leaq 0x8(%rsp), %rdi
callq 0x20f0
movq %rbx, %rdi
callq 0x2310
// File: /workspace/github_cpp_makefile_star2_O2/saumya-prakash[P]AssemblerEmulator/Assembler.cpp
// Function: Assembler::assemble()
void Assembler::assemble()
{   
    if(assembled==true)
        return;

    lines.clear();
    aux_lines.clear();
    errors.clear();
    warnings.clear();
    reset_pc();
    reset_data_addr();
    reset_line_cnt();

    first_pass();

    second_pass();

    generate_warnings();
    
    if(errors.empty())
    {
        generate_object_file();
        assembled = true;
    }

    if(!warnings.empty())
        warn = true;

    return ;
}

// Assembly:
cmpb $0x0, 0x128(%rdi)
jne 0x33e6
pushq %rbx
movq %rdi, %rbx
addq $0x60, %rdi
callq 0x5b56
leaq 0x78(%rbx), %rdi
callq 0x5b56
leaq 0xc8(%rbx), %rdi
callq 0x6674
leaq 0xf8(%rbx), %rdi
callq 0x66a2
movabsq $0x40000000000, %rax    # imm = 0x40000000000
movq %rax, 0x90(%rbx)
andl $0x0, 0x98(%rbx)
movq %rbx, %rdi
callq 0x33e8
movq %rbx, %rdi
callq 0x34da
movq %rbx, %rdi
callq 0x369e
cmpq $0x0, 0xf0(%rbx)
jne 0x33d4
movq %rbx, %rdi
callq 0x3748
movb $0x1, 0x128(%rbx)
cmpq $0x0, 0x120(%rbx)
je 0x33e5
movb $0x1, 0x129(%rbx)
popq %rbx
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/saumya-prakash[P]AssemblerEmulator/Assembler.cpp
// Function: Assembler::first_pass()
void Assembler::first_pass()
{
    string s;

    while(getline(src, s))
    {
        ++line_cnt;

        string::iterator it = s.begin();

        while(it!=s.end() && *it <= 32)     // remove leading whitespace
            ++it;
        
        string::iterator jt=it;

        while(jt!=s.end() && *jt!=';')      // remove comment part
            ++jt;

                                // removing trailing spaces -> NO NEED
        string tmp(it, jt);

        if(tmp.size()>0)    // put the non-empty line in the list
        {
            analyze(tmp);
        }

    }

    return ;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x48, %rsp
movq %rdi, %rbx
leaq 0x18(%rsp), %rax
movq %rax, -0x10(%rax)
andq $0x0, -0x8(%rax)
movb $0x0, (%rax)
leaq 0x38(%rsp), %r12
leaq 0x8(%rsp), %r14
leaq 0x28(%rsp), %r15
movq 0xa0(%rbx), %rdi
movq %r14, %rsi
callq 0x2060
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
testb $0x5, 0x20(%rax,%rcx)
jne 0x349e
incl 0x98(%rbx)
movq 0x8(%rsp), %rsi
movq 0x10(%rsp), %rax
leaq (%rsi,%rax), %rdx
testq %rax, %rax
je 0x3459
cmpb $0x20, (%rsi)
jg 0x345c
incq %rsi
decq %rax
jmp 0x3447
movq %rdx, %rsi
movq %rsi, %rax
cmpq %rdx, %rax
je 0x3471
cmpb $0x3b, (%rax)
je 0x346e
incq %rax
jmp 0x345f
movq %rax, %rdx
movq %r12, 0x28(%rsp)
movq %r15, %rdi
callq 0x66d0
cmpq $0x0, 0x30(%rsp)
je 0x3491
movq %rbx, %rdi
movq %r15, %rsi
callq 0x392e
movq %r15, %rdi
callq 0x20e0
jmp 0x3416
leaq 0x8(%rsp), %rdi
callq 0x20e0
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
movq %rax, %rbx
leaq 0x28(%rsp), %rdi
callq 0x20e0
jmp 0x34c8
jmp 0x34c5
movq %rax, %rbx
leaq 0x8(%rsp), %rdi
callq 0x20e0
movq %rbx, %rdi
callq 0x2310
// File: /workspace/github_cpp_makefile_star2_O2/saumya-prakash[P]AssemblerEmulator/Assembler.cpp
// Function: Assembler::second_pass()
void Assembler::second_pass()
{
    for(list<struct line>::iterator it=lines.begin(); it!=lines.end(); ++it)
    {
        string s = it->s;

        istringstream iss(s);

        string mnemonic;

        iss>>mnemonic;

        map<string, pair<unsigned, unsigned> >::iterator mt=optab.find(mnemonic);

        if(mt==optab.end())     // unknown mnemonic error
        {
            errors.insert({it->line_no, Error(3)});
            continue;           // process next line
        } 

        unsigned i_type = mt->second.first;
        unsigned opcode = mt->second.second;

        if(i_type==0)   // 0-operand mnemonic
        {
            unsigned res = encode_zeroth(s, opcode, it->line_no);

            if(res!=0xffffffff)
                it->encoding = res;
        }

        else        // 1-operand mnemonic
        {
            unsigned res = encode_first(s, opcode, it->line_no, it->addr);

            if(res!=0xffffffff)
                it->encoding = res;
        }
    }


    return ;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x228, %rsp            # imm = 0x228
leaq 0x60(%rdi), %rbp
movq %rdi, 0x8(%rsp)
leaq 0xc8(%rdi), %rax
movq %rax, 0x10(%rsp)
leaq 0x68(%rsp), %r12
leaq 0xa8(%rsp), %r15
leaq 0x20(%rsp), %rbx
leaq 0x88(%rsp), %r14
movq %rbp, 0x18(%rsp)
movq (%rbp), %rbp
cmpq 0x18(%rsp), %rbp
je 0x3637
leaq 0x10(%rbp), %rsi
movq %r12, %rdi
callq 0x2280
movq %r15, %rdi
movq %r12, %rsi
pushq $0x8
popq %rdx
callq 0x2300
leaq 0x30(%rsp), %rax
movq %rax, 0x20(%rsp)
andq $0x0, 0x28(%rsp)
movb $0x0, 0x30(%rsp)
movq %r15, %rdi
movq %rbx, %rsi
callq 0x2240
leaq 0x8c61(%rip), %rdi      # 0xc1d0
movq %rbx, %rsi
callq 0x6d28
leaq 0x8c5a(%rip), %rcx      # 0xc1d8
cmpq %rcx, %rax
je 0x35ac
leaq 0x30(%rbp), %rcx
cmpl $0x0, 0x40(%rax)
movl 0x44(%rax), %eax
movl %eax, 0x40(%rsp)
je 0x3600
leaq 0x34(%rbp), %r8
movq 0x8(%rsp), %rdi
movq %r12, %rsi
leaq 0x40(%rsp), %rdx
callq 0x4a76
jmp 0x3612
movq %rbx, %r12
movq %r15, %rbx
movq %r14, %r15
movq %r14, %rdi
pushq $0x3
popq %rsi
callq 0x5ba0
leaq 0x30(%rbp), %rsi
leaq 0x40(%rsp), %r13
movq %r13, %rdi
movq %r15, %rdx
callq 0x5bd0
movq 0x10(%rsp), %rdi
movq %r13, %rsi
callq 0x674a
leaq 0x48(%rsp), %rdi
callq 0x20e0
movq %r15, %rdi
callq 0x20e0
movq %rbx, %r15
movq %r12, %rbx
leaq 0x68(%rsp), %r12
jmp 0x361a
movq 0x8(%rsp), %rdi
movq %r12, %rsi
leaq 0x40(%rsp), %rdx
callq 0x493a
cmpl $-0x1, %eax
je 0x361a
movl %eax, 0x38(%rbp)
movq %rbx, %rdi
callq 0x20e0
movq %r15, %rdi
callq 0x20f0
movq %r12, %rdi
callq 0x20e0
jmp 0x351f
addq $0x228, %rsp            # imm = 0x228
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x3672
jmp 0x3672
movq %rax, %rbx
leaq 0x48(%rsp), %rdi
callq 0x20e0
leaq 0x88(%rsp), %rdi
callq 0x20e0
jmp 0x3675
jmp 0x3672
movq %rax, %rbx
jmp 0x368c
jmp 0x3672
movq %rax, %rbx
leaq 0x20(%rsp), %rdi
callq 0x20e0
leaq 0xa8(%rsp), %rdi
callq 0x20f0
leaq 0x68(%rsp), %rdi
callq 0x20e0
movq %rbx, %rdi
callq 0x2310
// File: /workspace/github_cpp_makefile_star2_O2/saumya-prakash[P]AssemblerEmulator/Assembler.cpp
// Function: Assembler::insert_into_symtab(label&)
void Assembler::insert_into_symtab(struct label& l)
{
    if(symtab.find(l.name)!=symtab.end())
    {
        errors.insert({line_cnt, Error(7)});
    }

    else
    {
        symtab[l.name] = l;
    }
    
    return;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x48, %rsp
movq %rsi, %r14
movq %rdi, %rbx
callq 0x6d9e
leaq 0x8(%rbx), %rcx
cmpq %rcx, %rax
je 0x48fb
leaq 0xc8(%rbx), %r14
addq $0x98, %rbx
movq %rsp, %r15
pushq $0x7
popq %rsi
movq %r15, %rdi
callq 0x5ba0
leaq 0x20(%rsp), %r12
movq %r12, %rdi
movq %rbx, %rsi
movq %r15, %rdx
callq 0x5bd0
movq %r14, %rdi
movq %r12, %rsi
callq 0x674a
leaq 0x28(%rsp), %rdi
callq 0x20e0
movq %rsp, %rdi
callq 0x20e0
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
movq %rbx, %rdi
movq %r14, %rsi
callq 0x5cf4
movq %rax, %rdi
movq %r14, %rsi
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
jmp 0x5d5a
movq %rax, %rbx
leaq 0x28(%rsp), %rdi
callq 0x20e0
movq %rsp, %rdi
callq 0x20e0
movq %rbx, %rdi
callq 0x2310
nop
// File: /workspace/github_cpp_makefile_star2_O2/saumya-prakash[P]AssemblerEmulator/Assembler.cpp
// Function: Assembler::encode_zeroth(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, unsigned int const&, unsigned int const&)
unsigned Assembler::encode_zeroth(const string& s, const unsigned& opcode, const unsigned& line_no)
{
    istringstream iss(s);
    string t;

    iss>>t;     // 'dump' mnemonic

    string more;
    iss>>more;

    if(!more.empty())   // more operands than required
    {
        errors.insert({line_no, Error(6)});
        return 0xffffffff;
    }

    return opcode;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x208, %rsp            # imm = 0x208
movq %rcx, %r14
movq %rdx, %r15
movq %rdi, %rbx
leaq 0x88(%rsp), %r12
pushq $0x8
popq %rdx
movq %r12, %rdi
callq 0x2300
leaq 0x50(%rsp), %rax
movq %rax, -0x10(%rax)
andq $0x0, -0x8(%rax)
movb $0x0, (%rax)
leaq 0x40(%rsp), %rsi
movq %r12, %rdi
callq 0x2240
leaq 0x10(%rsp), %rax
movq %rax, -0x10(%rax)
andq $0x0, -0x8(%rax)
movb $0x0, (%rax)
leaq 0x88(%rsp), %rdi
movq %rsp, %rsi
callq 0x2240
cmpq $0x0, 0x8(%rsp)
je 0x49f8
leaq 0x20(%rsp), %rdi
pushq $0x6
popq %rsi
callq 0x5ba0
addq $0xc8, %rbx
leaq 0x60(%rsp), %r15
leaq 0x20(%rsp), %rdx
movq %r15, %rdi
movq %r14, %rsi
callq 0x5ce4
movq %rbx, %rdi
movq %r15, %rsi
callq 0x674a
leaq 0x68(%rsp), %rdi
callq 0x20e0
leaq 0x20(%rsp), %rdi
callq 0x20e0
pushq $-0x1
popq %rbx
jmp 0x49fb
movl (%r15), %ebx
movq %rsp, %rdi
callq 0x20e0
leaq 0x40(%rsp), %rdi
callq 0x20e0
leaq 0x88(%rsp), %rdi
callq 0x20f0
movl %ebx, %eax
addq $0x208, %rsp            # imm = 0x208
popq %rbx
popq %r12
popq %r14
popq %r15
retq
movq %rax, %rbx
leaq 0x68(%rsp), %rdi
callq 0x20e0
leaq 0x20(%rsp), %rdi
callq 0x20e0
jmp 0x4a49
jmp 0x4a46
movq %rax, %rbx
movq %rsp, %rdi
callq 0x20e0
jmp 0x4a56
movq %rax, %rbx
leaq 0x40(%rsp), %rdi
callq 0x20e0
leaq 0x88(%rsp), %rdi
callq 0x20f0
movq %rbx, %rdi
callq 0x2310
nop
// File: /workspace/github_cpp_makefile_star2_O2/saumya-prakash[P]AssemblerEmulator/Assembler.cpp
// Function: Assembler::generate_log_file() const
void Assembler::generate_log_file() const
{
    string::size_type ind = filename.find_first_of('.');

    string log_name = string(filename.begin(), filename.begin()+ind);

    ofstream lg(log_name+".log", ofstream::out);

    if(!errors.empty())
    {
        lg<<"Errors -"<<endl;

        for(map<unsigned, class Error>::const_iterator et=errors.begin(); et!=errors.end(); ++et)
        {
            lg<<"Line "<<et->first<<": "<<et->second.message<<endl;
        }

        lg<<endl;
    }

    if(!warnings.empty())
    {
        lg<<"Warnings -"<<endl;

        for(map<unsigned, class Warning>::const_iterator wt=warnings.begin(); wt!=warnings.end(); ++wt)
        {
            lg<<"Line "<<wt->first<<": "<<wt->second.message<<endl;
        }

        lg<<endl;
    }

    lg.close();

}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x248, %rsp            # imm = 0x248
movq %rdi, %rbx
addq $0xa8, %rdi
pushq $0x2e
popq %rsi
xorl %edx, %edx
callq 0x2260
movq 0xa8(%rbx), %rsi
leaq (%rax,%rsi), %rdx
leaq 0x38(%rsp), %rax
movq %rax, -0x10(%rax)
leaq 0x28(%rsp), %r14
movq %r14, %rdi
callq 0x719a
leaq 0x2e1a(%rip), %rdx      # 0x8207
leaq 0x8(%rsp), %rdi
movq %r14, %rsi
callq 0x5c5c
leaq 0x48(%rsp), %rdi
leaq 0x8(%rsp), %rsi
pushq $0x10
popq %rdx
callq 0x2340
leaq 0x8(%rsp), %rdi
callq 0x20e0
cmpq $0x0, 0xf0(%rbx)
je 0x54b2
leaq 0x2de1(%rip), %rsi      # 0x820c
leaq 0x48(%rsp), %rdi
callq 0x21b0
movq %rax, %rdi
callq 0x2100
movq 0xe0(%rbx), %r12
leaq 0xd0(%rbx), %rbp
leaq 0x2dc3(%rip), %r14      # 0x8215
leaq 0x48(%rsp), %r15
leaq 0x2c0a(%rip), %r13      # 0x8068
cmpq %rbp, %r12
je 0x54a8
movq %r15, %rdi
movq %r14, %rsi
callq 0x21b0
movl 0x20(%r12), %esi
movq %rax, %rdi
callq 0x2140
movq %rax, %rdi
movq %r13, %rsi
callq 0x21b0
leaq 0x28(%r12), %rsi
movq %rax, %rdi
callq 0x21a0
movq %rax, %rdi
callq 0x2100
movq %r12, %rdi
callq 0x2210
movq %rax, %r12
jmp 0x545e
leaq 0x48(%rsp), %rdi
callq 0x2100
cmpq $0x0, 0x120(%rbx)
je 0x554c
leaq 0x2d54(%rip), %rsi      # 0x821b
leaq 0x48(%rsp), %rdi
callq 0x21b0
movq %rax, %rdi
callq 0x2100
movq 0x110(%rbx), %r15
addq $0x100, %rbx            # imm = 0x100
leaq 0x2d27(%rip), %r14      # 0x8215
leaq 0x48(%rsp), %r12
leaq 0x2b6e(%rip), %r13      # 0x8068
cmpq %rbx, %r15
je 0x5542
movq %r12, %rdi
movq %r14, %rsi
callq 0x21b0
movl 0x20(%r15), %esi
movq %rax, %rdi
callq 0x2140
movq %rax, %rdi
movq %r13, %rsi
callq 0x21b0
leaq 0x28(%r15), %rsi
movq %rax, %rdi
callq 0x21a0
movq %rax, %rdi
callq 0x2100
movq %r15, %rdi
callq 0x2210
movq %rax, %r15
jmp 0x54fa
leaq 0x48(%rsp), %rdi
callq 0x2100
leaq 0x48(%rsp), %rdi
callq 0x2290
leaq 0x48(%rsp), %rdi
callq 0x22b0
leaq 0x28(%rsp), %rdi
callq 0x20e0
addq $0x248, %rsp            # imm = 0x248
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
leaq 0x8(%rsp), %rdi
callq 0x20e0
jmp 0x55a1
movq %rax, %rbx
jmp 0x55a1
jmp 0x5594
jmp 0x5594
movq %rax, %rbx
leaq 0x48(%rsp), %rdi
callq 0x22b0
leaq 0x28(%rsp), %rdi
callq 0x20e0
movq %rbx, %rdi
callq 0x2310
nop
// File: /workspace/github_cpp_makefile_star2_O2/saumya-prakash[P]AssemblerEmulator/Assembler.cpp
// Function: Assembler::print_bytes(std::ostream&, unsigned int) const
void Assembler::print_bytes(ostream& os, unsigned a) const
{
    char *ptr = (char *) &a;

    if(machine_type==lil_endian)     // reverse bytes
    {
        ptr += 3;

        os.write(ptr, 1);

        ptr--;
        os.write(ptr, 1);

        ptr--;
        os.write(ptr, 1);

        ptr--;
        os.write(ptr, 1);    
    }

    else        // no need to reverse bytes
    {
        os.write(ptr, 1);

        ptr++;
        os.write(ptr, 1);

        ptr++;
        os.write(ptr, 1);

        ptr++;
        os.write(ptr, 1);
    }
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movl %edx, 0x4(%rsp)
cmpl $0x0, 0x6c9a(%rip)      # 0xc260
je 0x5603
leaq 0x4(%rsp), %rsi
pushq $0x1
popq %r14
movq %rbx, %rdi
movq %r14, %rdx
callq 0x2270
leaq 0x5(%rsp), %rsi
movq %rbx, %rdi
movq %r14, %rdx
callq 0x2270
leaq 0x6(%rsp), %rsi
movq %rbx, %rdi
movq %r14, %rdx
callq 0x2270
leaq 0x7(%rsp), %rsi
jmp 0x563c
leaq 0x7(%rsp), %rsi
pushq $0x1
popq %r14
movq %rbx, %rdi
movq %r14, %rdx
callq 0x2270
leaq 0x6(%rsp), %rsi
movq %rbx, %rdi
movq %r14, %rdx
callq 0x2270
leaq 0x5(%rsp), %rsi
movq %rbx, %rdi
movq %r14, %rdx
callq 0x2270
leaq 0x4(%rsp), %rsi
pushq $0x1
popq %rdx
movq %rbx, %rdi
callq 0x2270
addq $0x8, %rsp
popq %rbx
popq %r14
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/saumya-prakash[P]AssemblerEmulator/Assembler.cpp
// Function: Assembler::print_errors(std::ostream&) const
void Assembler::print_errors(ostream &os) const
{
    for(map<unsigned, class Error>::const_iterator it=errors.begin(); it!=errors.end(); ++it)
    {
        unsigned line_no = it->first;

        class Error tmp = it->second;

        os<<"Line "<<line_no<<": "<<tmp.message<<endl;
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rsi, %rbx
movq %rdi, %r14
movq 0xe0(%rdi), %r12
addq $0xd0, %r14
leaq 0x8(%rsp), %r15
leaq 0x28e6(%rip), %rbp      # 0x8068
cmpq %r14, %r12
je 0x57e6
movl 0x20(%r12), %r13d
leaq 0x28(%r12), %rsi
movq %r15, %rdi
callq 0x2280
movq %rbx, %rdi
leaq 0x2a72(%rip), %rsi      # 0x8215
callq 0x21b0
movq %rax, %rdi
movq %r13, %rsi
callq 0x2140
movq %rax, %rdi
movq %rbp, %rsi
callq 0x21b0
movq %rax, %rdi
movq %r15, %rsi
callq 0x21a0
movq %rax, %rdi
callq 0x2100
movq %r15, %rdi
callq 0x20e0
movq %r12, %rdi
callq 0x2210
movq %rax, %r12
jmp 0x5782
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
leaq 0x8(%rsp), %rdi
callq 0x20e0
movq %rbx, %rdi
callq 0x2310
// File: /workspace/github_cpp_makefile_star2_O2/saumya-prakash[P]AssemblerEmulator/Assembler.cpp
// Function: Assembler::print_symtab(std::ostream&) const
void Assembler::print_symtab(ostream& os) const
{
    for(map<string, struct label>::const_iterator it=symtab.begin(); it!=symtab.end(); ++it)
    {
        string name = it->first;
        struct label l = it->second;

        os<<name<<'\t'<<l.addr<<endl;
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x58, %rsp
movq %rsi, %rbx
movq %rdi, %r14
movq 0x18(%rdi), %r12
addq $0x8, %r14
leaq 0x38(%rsp), %r15
leaq 0x8(%rsp), %r13
pushq $0x9
popq %rbp
cmpq %r14, %r12
je 0x5898
leaq 0x20(%r12), %rsi
movq %r15, %rdi
callq 0x2280
leaq 0x40(%r12), %rsi
movq %r13, %rdi
callq 0x5d84
movq %rbx, %rdi
movq %r15, %rsi
callq 0x21a0
movq %rax, %rdi
movl %ebp, %esi
callq 0x2220
movl 0x28(%rsp), %esi
movq %rax, %rdi
callq 0x2140
movq %rax, %rdi
callq 0x2100
movq %r13, %rdi
callq 0x20e0
movq %r15, %rdi
callq 0x20e0
movq %r12, %rdi
callq 0x2210
movq %rax, %r12
jmp 0x5833
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
jmp 0x58b9
movq %rax, %rbx
leaq 0x8(%rsp), %rdi
callq 0x20e0
leaq 0x38(%rsp), %rdi
callq 0x20e0
movq %rbx, %rdi
callq 0x2310
nop
// File: /workspace/github_cpp_makefile_star2_O2/saumya-prakash[P]AssemblerEmulator/Assembler.cpp
// Function: Assembler::print_warnings(std::ostream&) const
void Assembler::print_warnings(ostream& os) const
{
    for(map<unsigned, class Warning>::const_iterator it=warnings.begin(); it!=warnings.end(); ++it)
    {
        unsigned a = it->first;
        class Warning b = it->second;

        os<<"Line "<<a<<": "<<b.message<<endl;
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rsi, %rbx
movq %rdi, %r14
movq 0x110(%rdi), %r12
addq $0x100, %r14            # imm = 0x100
leaq 0x8(%rsp), %r15
leaq 0x276e(%rip), %rbp      # 0x8068
cmpq %r14, %r12
je 0x595e
movl 0x20(%r12), %r13d
leaq 0x28(%r12), %rsi
movq %r15, %rdi
callq 0x2280
movq %rbx, %rdi
leaq 0x28fa(%rip), %rsi      # 0x8215
callq 0x21b0
movq %rax, %rdi
movq %r13, %rsi
callq 0x2140
movq %rax, %rdi
movq %rbp, %rsi
callq 0x21b0
movq %rax, %rdi
movq %r15, %rsi
callq 0x21a0
movq %rax, %rdi
callq 0x2100
movq %r15, %rdi
callq 0x20e0
movq %r12, %rdi
callq 0x2210
movq %rax, %r12
jmp 0x58fa
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
leaq 0x8(%rsp), %rdi
callq 0x20e0
movq %rbx, %rdi
callq 0x2310
// File: /workspace/github_cpp_makefile_star2_O2/saumya-prakash[P]AssemblerEmulator/./Assembler.h
// Function: label::validate(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&)
string validate(const string &s)    // checks for valid label name
        {
            if(isalpha(s[0])==0)    // first character should be an alphabet
                return string();
                
            for(string::const_iterator it=s.begin(); it!=s.end(); ++it)     // should consist of only alpha-numerics
                if(*it<=32 || isalnum(*it)==0)
                    return string();

            return s;
        }

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %rdx, %r14
movq %rdi, %rbx
movq (%rdx), %r15
movsbl (%r15), %edi
callq 0x22e0
testl %eax, %eax
je 0x5eb3
movq 0x8(%r14), %r12
xorl %r13d, %r13d
cmpq %r13, %r12
je 0x5ec5
movsbl (%r15,%r13), %edi
cmpl $0x21, %edi
jl 0x5eb3
callq 0x21e0
incq %r13
testl %eax, %eax
jne 0x5e98
leaq 0x10(%rbx), %rax
movq %rax, (%rbx)
andq $0x0, 0x8(%rbx)
movb $0x0, 0x10(%rbx)
jmp 0x5ed0
movq %rbx, %rdi
movq %r14, %rsi
callq 0x2280
movq %rbx, %rax
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/hollanderic[P]dp832/dp832.cpp
// Function: dp830::write_(char const*)
int dp830::write_(const char *command) {
    assert(fhandle_);
    int len = strlen(command);
    fhandle_.write(command,len);
    //printf("write: -->%s<--\n",command);
    fhandle_.flush();
    return len;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq (%rdi), %rax
movq -0x18(%rax), %rax
testb $0x5, 0x20(%rdi,%rax)
jne 0x2465
movq %rsi, %r14
movq %rdi, %rbx
movq %rsi, %rdi
callq 0x20c0
addq $0x10, %rbx
movslq %eax, %r15
movq %rbx, %rdi
movq %r14, %rsi
movq %r15, %rdx
callq 0x2170
movq %rbx, %rdi
callq 0x2100
movl %r15d, %eax
popq %rbx
popq %r14
popq %r15
retq
leaq 0x1ba4(%rip), %rdi      # 0x4010
leaq 0x1ba6(%rip), %rsi      # 0x4019
leaq 0x1ba9(%rip), %rcx      # 0x4023
pushq $0x10
popq %rdx
callq 0x20f0
// File: /workspace/github_cpp_makefile_star2_O2/hollanderic[P]dp832/dp832.cpp
// Function: dp830::read_(char*, int)
int dp830::read_(char *buf, int len){
    assert(fhandle_);
    if (!buf) return 0;
    memset(buf,0,len);
    fhandle_.getline(buf,len);
    return fhandle_.gcount();
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq (%rdi), %rax
movq -0x18(%rax), %rax
testb $0x5, 0x20(%rdi,%rax)
jne 0x24cb
movq %rsi, %r14
testq %rsi, %rsi
je 0x24c3
movq %rdi, %rbx
movslq %edx, %r15
movq %r14, %rdi
xorl %esi, %esi
movq %r15, %rdx
callq 0x20d0
movq %rbx, %rdi
movq %r14, %rsi
movq %r15, %rdx
callq 0x20a0
movl 0x8(%rbx), %eax
jmp 0x24c5
xorl %eax, %eax
popq %rbx
popq %r14
popq %r15
retq
leaq 0x1b3e(%rip), %rdi      # 0x4010
leaq 0x1b40(%rip), %rsi      # 0x4019
leaq 0x1b63(%rip), %rcx      # 0x4043
pushq $0x19
popq %rdx
callq 0x20f0
// File: /workspace/github_cpp_makefile_star2_O2/hollanderic[P]dp832/dp832.cpp
// Function: dp830::GetState(int)
int dp830::GetState(int channel){
    char buf[40];
    char buf2[40];
    snprintf(buf,sizeof(buf),":OUTP:STAT? CH%d",channel);
    write_(buf);
    read_(buf2,sizeof(buf2));
    return strcmp(buf2,"OFF")?1:0;
}

// Assembly:
pushq %r14
pushq %rbx
subq $0x58, %rsp
movl %esi, %ecx
movq %rdi, %rbx
leaq 0x1b66(%rip), %rdx      # 0x4061
leaq 0x30(%rsp), %r14
pushq $0x28
popq %rsi
movq %r14, %rdi
xorl %eax, %eax
callq 0x21d0
movq %rbx, %rdi
movq %r14, %rsi
callq 0x241e
movq %rsp, %r14
pushq $0x28
popq %rdx
movq %rbx, %rdi
movq %r14, %rsi
callq 0x2482
xorl %eax, %eax
cmpl $0x46464f, (%r14)       # imm = 0x46464F
setne %al
addq $0x58, %rsp
popq %rbx
popq %r14
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/hollanderic[P]dp832/dp832.cpp
// Function: dp830::On(int)
int dp830::On(int channel) {
    char buf[40];
    snprintf(buf,sizeof(buf),":SOUR%d:CURR:PROT:CLEAR",channel);
    write_(buf);
    snprintf(buf,sizeof(buf),":OUTP:STAT CH%d,ON",channel);
    return write_(buf);
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x28, %rsp
movl %esi, %ebx
movq %rdi, %r14
leaq 0x1b1d(%rip), %rdx      # 0x4072
movq %rsp, %r15
pushq $0x28
popq %r12
movq %r15, %rdi
movq %r12, %rsi
movl %ebx, %ecx
xorl %eax, %eax
callq 0x21d0
movq %r14, %rdi
movq %r15, %rsi
callq 0x241e
leaq 0x1b0d(%rip), %rdx      # 0x408a
movq %r15, %rdi
movq %r12, %rsi
movl %ebx, %ecx
xorl %eax, %eax
callq 0x21d0
movq %r14, %rdi
movq %r15, %rsi
callq 0x241e
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/hollanderic[P]dp832/dp832.cpp
// Function: dp830::AllOn()
int dp830::AllOn() {
    On(1);
    On(2);
    On(3);
    return 0;
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
pushq $0x1
popq %rsi
callq 0x253e
pushq $0x2
popq %rsi
movq %rbx, %rdi
callq 0x253e
pushq $0x3
popq %rsi
movq %rbx, %rdi
callq 0x253e
xorl %eax, %eax
popq %rbx
retq
// File: /workspace/github_cpp_makefile_star2_O2/hollanderic[P]dp832/dp832.cpp
// Function: dp830::AllOff()
int dp830::AllOff() {
    Off(1);
    Off(2);
    Off(3);
    return 0;
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
pushq $0x1
popq %rsi
callq 0x25ca
pushq $0x2
popq %rsi
movq %rbx, %rdi
callq 0x25ca
pushq $0x3
popq %rsi
movq %rbx, %rdi
callq 0x25ca
xorl %eax, %eax
popq %rbx
retq
// File: /workspace/github_cpp_makefile_star2_O2/hollanderic[P]dp832/dp832.cpp
// Function: dp830::SetOCP(int, double)
int dp830::SetOCP(int channel, double limit) {
    char buf[60];
    snprintf(buf,sizeof(buf),":SOUR%d:CURR:PROT:STAT ON",channel);
    write_(buf);
    snprintf(buf,sizeof(buf),":SOUR%d:CURR:PROT %6.3f",channel,limit);
    return write_(buf);
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x58, %rsp
movsd %xmm0, 0x8(%rsp)
movl %esi, %ebx
movq %rdi, %r14
leaq 0x1a36(%rip), %rdx      # 0x40cb
leaq 0x10(%rsp), %r15
pushq $0x3c
popq %r12
movq %r15, %rdi
movq %r12, %rsi
movl %ebx, %ecx
xorl %eax, %eax
callq 0x21d0
movq %r14, %rdi
movq %r15, %rsi
callq 0x241e
leaq 0x1a26(%rip), %rdx      # 0x40e5
movq %r15, %rdi
movq %r12, %rsi
movl %ebx, %ecx
movsd 0x8(%rsp), %xmm0
movb $0x1, %al
callq 0x21d0
movq %r14, %rdi
movq %r15, %rsi
callq 0x241e
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/hollanderic[P]dp832/dp832.cpp
// Function: dp830::GetOCP(int)
double dp830::GetOCP(int channel) {
    char buf[40];
    snprintf(buf,sizeof(buf),":SOUR%d:CURR:PROT?",channel);
    write_(buf);
    read_(buf,sizeof(buf));
    return std::stod(buf,NULL);
}

// Assembly:
pushq %r14
pushq %rbx
subq $0x58, %rsp
movl %esi, %ecx
movq %rdi, %rbx
leaq 0x19fe(%rip), %rdx      # 0x40fd
leaq 0x30(%rsp), %r14
pushq $0x28
popq %rsi
movq %r14, %rdi
xorl %eax, %eax
callq 0x21d0
movq %rbx, %rdi
movq %r14, %rsi
callq 0x241e
pushq $0x28
popq %rdx
movq %rbx, %rdi
movq %r14, %rsi
callq 0x2482
leaq 0x10(%rsp), %rbx
leaq 0x7(%rsp), %rdx
movq %rbx, %rdi
movq %r14, %rsi
callq 0x29c6
movq %rbx, %rdi
xorl %esi, %esi
callq 0x29ad
movsd %xmm0, 0x8(%rsp)
leaq 0x10(%rsp), %rdi
callq 0x2218
movsd 0x8(%rsp), %xmm0
addq $0x58, %rsp
popq %rbx
popq %r14
retq
movq %rax, %rbx
leaq 0x10(%rsp), %rdi
callq 0x2218
movq %rbx, %rdi
callq 0x21e0
// File: /workspace/github_cpp_makefile_star2_O2/hollanderic[P]dp832/dp832.cpp
// Function: dp830::GetOCPTripped(int)
int dp830::GetOCPTripped(int channel) {
    char buf[40];
    snprintf(buf,sizeof(buf),":SOUR%d:CURR:PROT:TRIP?",channel);
    write_(buf);
    read_(buf,sizeof(buf));
    return (strcmp(buf,"YES")==0)?1:0;
}

// Assembly:
pushq %r14
pushq %rbx
subq $0x28, %rsp
movl %esi, %ecx
movq %rdi, %rbx
leaq 0x1981(%rip), %rdx      # 0x4110
movq %rsp, %r14
pushq $0x28
popq %rsi
movq %r14, %rdi
xorl %eax, %eax
callq 0x21d0
movq %rbx, %rdi
movq %r14, %rsi
callq 0x241e
pushq $0x28
popq %rdx
movq %rbx, %rdi
movq %r14, %rsi
callq 0x2482
xorl %eax, %eax
cmpl $0x534559, (%r14)       # imm = 0x534559
sete %al
addq $0x28, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_cpp_makefile_star2_O2/hollanderic[P]dp832/dp832.cpp
// Function: dp830::GetSetPoint_(int, char const*)
double dp830::GetSetPoint_(int channel, const char *tag) {
    char buf[40];
    char buf2[40];
    snprintf(buf,sizeof(buf),":SOUR%d:%s?",channel,tag);
    write_(buf);
    read_(buf2,sizeof(buf2));
    return std::stod(buf2,NULL);
}

// Assembly:
pushq %r14
pushq %rbx
subq $0x88, %rsp
movq %rdx, %r8
movl %esi, %ecx
movq %rdi, %rbx
leaq 0x1943(%rip), %rdx      # 0x4128
leaq 0x60(%rsp), %r14
pushq $0x28
popq %rsi
movq %r14, %rdi
xorl %eax, %eax
callq 0x21d0
movq %rbx, %rdi
movq %r14, %rsi
callq 0x241e
leaq 0x30(%rsp), %r14
pushq $0x28
popq %rdx
movq %rbx, %rdi
movq %r14, %rsi
callq 0x2482
leaq 0x10(%rsp), %rbx
leaq 0x7(%rsp), %rdx
movq %rbx, %rdi
movq %r14, %rsi
callq 0x29c6
movq %rbx, %rdi
xorl %esi, %esi
callq 0x29ad
movsd %xmm0, 0x8(%rsp)
leaq 0x10(%rsp), %rdi
callq 0x2218
movsd 0x8(%rsp), %xmm0
addq $0x88, %rsp
popq %rbx
popq %r14
retq
movq %rax, %rbx
leaq 0x10(%rsp), %rdi
callq 0x2218
movq %rbx, %rdi
callq 0x21e0
// File: /workspace/github_cpp_makefile_star2_O2/hollanderic[P]dp832/dp832.cpp
// Function: dp830::Measure_(int, char const*)
double dp830::Measure_(int channel, const char *tag) {
    char buf[40];
    char buf2[40];
    snprintf(buf,sizeof(buf),":MEAS:%s? CH%d",tag,channel);
    write_(buf);
    read_(buf2,sizeof(buf2));
    return std::stod(buf2,NULL);
}

// Assembly:
pushq %r14
pushq %rbx
subq $0x88, %rsp
movq %rdx, %rcx
movl %esi, %r8d
movq %rdi, %rbx
leaq 0x1898(%rip), %rdx      # 0x4134
leaq 0x60(%rsp), %r14
pushq $0x28
popq %rsi
movq %r14, %rdi
xorl %eax, %eax
callq 0x21d0
movq %rbx, %rdi
movq %r14, %rsi
callq 0x241e
leaq 0x30(%rsp), %r14
pushq $0x28
popq %rdx
movq %rbx, %rdi
movq %r14, %rsi
callq 0x2482
leaq 0x10(%rsp), %rbx
leaq 0x7(%rsp), %rdx
movq %rbx, %rdi
movq %r14, %rsi
callq 0x29c6
movq %rbx, %rdi
xorl %esi, %esi
callq 0x29ad
movsd %xmm0, 0x8(%rsp)
leaq 0x10(%rsp), %rdi
callq 0x2218
movsd 0x8(%rsp), %xmm0
addq $0x88, %rsp
popq %rbx
popq %r14
retq
movq %rax, %rbx
leaq 0x10(%rsp), %rdi
callq 0x2218
movq %rbx, %rdi
callq 0x21e0
nop
// File: /workspace/github_cpp_makefile_star2_O2/hollanderic[P]dp832/dp832.cpp
// Function: dp830::Bounce(int, double)
int dp830::Bounce(int channel, double delay) {
    double volt = GetVoltageSetPoint(channel);
    SetVoltage(channel, 0.0);
    usleep(delay*1e6);
    SetVoltage(channel, volt);
    return 0;
}

// Assembly:
pushq %r14
pushq %rbx
subq $0x18, %rsp
movsd %xmm0, 0x8(%rsp)
movl %esi, %ebx
movq %rdi, %r14
callq 0x286a
movsd %xmm0, 0x10(%rsp)
xorps %xmm0, %xmm0
movq %r14, %rdi
movl %ebx, %esi
callq 0x2660
movsd 0x8(%rsp), %xmm0
mulsd 0x168a(%rip), %xmm0     # 0x4008
cvttsd2si %xmm0, %rdi
callq 0x2190
movq %r14, %rdi
movl %ebx, %esi
movsd 0x10(%rsp), %xmm0
callq 0x2660
xorl %eax, %eax
addq $0x18, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_cpp_makefile_star2_O2/hollanderic[P]dp832/main.cpp
// Function: getDevicePathArg[abi:cxx11](int, char**)
const std::string getDevicePathArg(int argc, char** argv) {
    char opt;
    std::string result = kDefaultUSBDevicePath;
    while ((opt = getopt(argc, argv, kValidArgs.c_str())) >= 0) {
        if (opt == 'd') {
            result = string(optarg);
            break;
        }
    }

    // Reset option parser.
    optind = 1; 

    return result;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
subq $0x30, %rsp
movq %rdx, %r14
movl %esi, %ebp
movq %rdi, %rbx
leaq 0x35ed(%rip), %rsi      # 0x6150
callq 0x2180
movq 0x35c1(%rip), %rdx      # 0x6130
movl %ebp, %edi
movq %r14, %rsi
callq 0x2080
shll $0x18, %eax
js 0x2bb6
cmpl $0x64000000, %eax       # imm = 0x64000000
jne 0x2b68
movq 0x342c(%rip), %rax      # 0x5fb8
movq (%rax), %rsi
leaq 0x10(%rsp), %rdi
leaq 0xf(%rsp), %rdx
callq 0x29c6
leaq 0x10(%rsp), %r14
movq %rbx, %rdi
movq %r14, %rsi
callq 0x2160
movq %r14, %rdi
callq 0x2218
movq 0x341b(%rip), %rax      # 0x5fd8
movl $0x1, (%rax)
movq %rbx, %rax
addq $0x30, %rsp
popq %rbx
popq %r14
popq %rbp
retq
movq %rax, %r14
movq %rbx, %rdi
callq 0x2218
movq %r14, %rdi
callq 0x21e0
// File: /workspace/github_cpp_makefile_star2_O2/hollanderic[P]dp832/main.cpp
// Function: isExtraMode(int, char**)
bool isExtraMode(int argc, char** argv) {
    char opt;
    bool result = false;
    while ((opt = getopt(argc, argv, kValidArgs.c_str())) >= 0) {
        if (opt == 'x') {
            result = true;
            break;
        }
    }

    // Reset option parser.
    optind = 1; 

    return result;
}

// Assembly:
pushq %rbp
pushq %rbx
pushq %rax
movq %rsi, %rbx
movl %edi, %ebp
movq 0x353f(%rip), %rdx      # 0x6130
movl %ebp, %edi
movq %rbx, %rsi
callq 0x2080
shll $0x18, %eax
cmpl $0x78000000, %eax       # imm = 0x78000000
je 0x2c09
testl %eax, %eax
jns 0x2bea
testl %eax, %eax
setns %al
movq 0x33c3(%rip), %rcx      # 0x5fd8
movl $0x1, (%rcx)
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/nanjiangshu[P]calSOV/calSOV.cpp
// Function: my_strcpy(char*, char const*, int)
int my_strcpy(char* to, const char* from, int max)/*{{{*/
/******************************************************************************
 * my modification of strcpy
 * copy max characters from "from" to "to", add NULL terminator automatically
 * updated 2008-04-23, memcpy win in speed when the copying string is long
 * updated 2011-10-27:
 *   since calling strlen will be time consuming for very large from string,
 *   e.g. when "from" is the buffer of a whole trunk of file. Therefore, strlen
 *   part is removed.
 *****************************************************************************/
{
    if(max < 200) {
        strncpy(to,from,max);
    } else {
        memcpy(to,from,max);
    }
    to[max] = '\0';
    return max;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movl %edx, %ebx
movq %rdi, %r14
cmpl $0xc7, %edx
jg 0x26da
movslq %ebx, %r15
movq %r14, %rdi
movq %r15, %rdx
callq 0x2110
jmp 0x26e8
movl %ebx, %r15d
movq %r14, %rdi
movq %r15, %rdx
callq 0x2170
movb $0x0, (%r14,%r15)
movl %ebx, %eax
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O2/nanjiangshu[P]calSOV/calSOV.cpp
// Function: rootname(char const*, char*, int)
char *rootname(const char* filename, char* rtname, int max_rtname /*= MAX_PATH*/)/*{{{*/
/*****************************************************************************
 * rootname
 * given the file name, 
 * return the rootname of the filename
 ****************************************************************************/
{
    const char *pch;
    char *pstr;
    if((pch = strrchr(filename,'/')) != NULL)
        pstr = (char*) pch+1;
    else
        pstr = (char*) filename;

    if((pch = strrchr(pstr,'.')) != NULL)
        my_strcpy(rtname,pstr, min((int)(pch - pstr), max_rtname));
    else
        rtname = pstr;
    return rtname;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movl %edx, %ebp
movq %rsi, %rbx
movq %rdi, %r15
pushq $0x2f
popq %rsi
callq 0x21f0
leaq 0x1(%rax), %r14
testq %rax, %rax
cmoveq %r15, %r14
pushq $0x2e
popq %rsi
movq %r14, %rdi
callq 0x21f0
testq %rax, %rax
je 0x273e
subl %r14d, %eax
cmpl %ebp, %eax
cmovgel %ebp, %eax
movq %rbx, %rdi
movq %r14, %rsi
movl %eax, %edx
callq 0x26b8
jmp 0x2741
movq %r14, %rbx
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/nanjiangshu[P]calSOV/calSOV.cpp
// Function: option_parser_filename(int, char**, int, char*)
int option_parser_filename(int argc, char **argv, int beg, char *filename)/*{{{*/
/*****************************************************************************
 * beg is the current index of argument list, e.g., argv[i] = "--out"
 ****************************************************************************/
{
    int i ; 
    bool isNonOptionArg = false;
    bool isFileNameSet = false;

    for(i = beg +1 ; i < argc ; i++)
    {
        if(argv[i][0] == '-' && strcmp(argv[i], "--") != 0 && !isNonOptionArg)
        {
            fprintf(stderr,"option '%s' must be followed by a filename, not option\n", argv[beg]);
            return -1;
        }
        else if(strcmp(argv[i], "--") == 0 && !isNonOptionArg)
        {
            isNonOptionArg = true;
        }
        else
        {
            my_strcpy(filename, argv[i], MAX_PATH-1);
            isFileNameSet = true;
            break;
        }
    }

    if(!isFileNameSet)
    {
        fprintf(stderr,"option '%s' must be followed by a filename\n", argv[beg]);
        return -1;
    }
    else 
    {
        return i+1;
    }
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rcx, %rbx
movslq %edx, %rcx
movslq %edi, %rdx
leal 0x2(%rcx), %r9d
leaq 0x1(%rcx), %rdi
xorl %r8d, %r8d
cmpq %rdx, %rdi
jge 0x27d7
movl %r9d, %r14d
movq (%rsi,%rdi,8), %rax
cmpb $0x2d, (%rax)
jne 0x27b5
cmpb $0x2d, 0x1(%rax)
jne 0x2788
cmpb $0x0, 0x2(%rax)
sete %r9b
jmp 0x278b
xorl %r9d, %r9d
orb %r8b, %r9b
testb $0x1, %r9b
je 0x27ee
cmpb $0x2d, 0x1(%rax)
jne 0x27b5
cmpb $0x0, 0x2(%rax)
setne %r9b
orb %r9b, %r8b
leal 0x1(%r14), %r9d
incq %rdi
testb $0x1, %r8b
movb $0x1, %r8b
je 0x2767
movl $0x1f3, %edx            # imm = 0x1F3
movq %rbx, %rdi
movq %rax, %rsi
callq 0x2170
movb $0x0, 0x1f3(%rbx)
movl %r14d, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
movq 0x87fa(%rip), %rax      # 0xafd8
movq (%rax), %rdi
movq (%rsi,%rcx,8), %rdx
leaq 0x4edf(%rip), %rsi      # 0x76cb
jmp 0x2803
movq 0x87e3(%rip), %rax      # 0xafd8
movq (%rax), %rdi
movq (%rsi,%rcx,8), %rdx
leaq 0x4e90(%rip), %rsi      # 0x7693
xorl %eax, %eax
callq 0x2290
pushq $-0x1
popq %r14
jmp 0x27cc
// File: /workspace/github_cpp_makefile_star2_O2/nanjiangshu[P]calSOV/calSOV.cpp
// Function: IsNumeric(char const*)
bool IsNumeric(const char* str)/*{{{*/
//**********************************************************************
//IsNumeric(char*)
//check if a string is a numeric number
{
	int i = 0;
    int cntdot = 0;
	while(str[i] != '\0')
	{
        if( i == 0)
        {
            if(!isdigit(str[i]) && str[i] != '+' && str[i] != '-' && str[i] != '.' )
                return false;
            if(str[i] == '.')
                cntdot ++;
        }
        else
        {
            if(! isdigit(str[i]) && str[i] != '.')
                return false;
            if(str[i] == '.')
                cntdot ++;
        }
        i ++;
	}
    if(cntdot >= 2)
        return false;
    else 
        return true;
}

// Assembly:
xorl %ecx, %ecx
movabsq $0x680000000000, %rdx   # imm = 0x680000000000
xorl %esi, %esi
movb (%rdi,%rcx), %r8b
testb %r8b, %r8b
je 0x2874
movsbl %r8b, %eax
addl $-0x30, %eax
testq %rcx, %rcx
je 0x284c
cmpl $0xa, %eax
setae %r9b
cmpb $0x2e, %r8b
sete %al
setne %r8b
testb %r9b, %r8b
je 0x286a
jmp 0x287b
cmpl $0xa, %eax
jb 0x2863
xorl %eax, %eax
cmpb $0x2e, %r8b
ja 0x287a
movzbl %r8b, %r9d
btq %r9, %rdx
jae 0x287a
cmpb $0x2e, %r8b
sete %al
movzbl %al, %eax
addl %eax, %esi
incq %rcx
jmp 0x281e
cmpl $0x2, %esi
setb %al
retq
xorl %eax, %eax
retq