LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_cpp_makefile_star2_O2/TasnimAnas[P]Attendance-Management-System/src/StudentAdd.cpp
// Function: add(int, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>)
void add(int roll, string name)
{
    StudentClass std;
    std.setName(name);
    std.setRoll(roll);
    ::Student.push_back(std);
}

// Assembly:
pushq %r14
pushq %rbx
subq $0x78, %rsp
movq %rsi, %r14
movl %edi, %ebx
leaq 0x28(%rsp), %rdi
callq 0x3338
leaq 0x8(%rsp), %rdi
movq %r14, %rsi
callq 0x2260
leaq 0x28(%rsp), %rdi
leaq 0x8(%rsp), %rsi
callq 0x39f0
leaq 0x8(%rsp), %rdi
callq 0x20d0
leaq 0x28(%rsp), %rdi
movl %ebx, %esi
callq 0x39e8
leaq 0x80ee(%rip), %rdi      # 0xb1f8
leaq 0x28(%rsp), %rsi
callq 0x3372
leaq 0x28(%rsp), %rdi
callq 0x339e
addq $0x78, %rsp
popq %rbx
popq %r14
retq
movq %rax, %rbx
leaq 0x8(%rsp), %rdi
callq 0x20d0
jmp 0x3138
movq %rax, %rbx
leaq 0x28(%rsp), %rdi
callq 0x339e
movq %rbx, %rdi
callq 0x2330
// File: /workspace/github_cpp_makefile_star2_O2/TasnimAnas[P]Attendance-Management-System/src/StudentAdd.cpp
// Function: SortStudentList()
void SortStudentList()
{
    for (int i = 1; i < ::Student.size(); i++)
    {
        ::StudentClass temp = ::Student[i];
        int j = i - 1;
        while (temp.getRoll() < Student[j].getRoll() && j >= 0)
        {
            Student[j + 1] = Student[j];
            j--;
        }
        Student[j + 1] = temp;
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x68, %rsp
movabsq $0x100000000, %r12      # imm = 0x100000000
pushq $0x1
popq %r14
xorl %r15d, %r15d
leaq 0x8088(%rip), %r13      # 0xb1f8
leaq 0x18(%rsp), %rbx
movq (%r13), %rsi
movq 0x8(%r13), %rax
subq %rsi, %rax
cqto
pushq $0x50
popq %rcx
idivq %rcx
cmpq %r14, %rax
jbe 0x323b
imulq $0x50, %r14, %rax
addq %rax, %rsi
movq %rbx, %rdi
callq 0x33b4
movq %r15, 0x8(%rsp)
movq %r12, (%rsp)
movq %r14, 0x10(%rsp)
movq %rbx, %rdi
callq 0x39ec
movl %eax, %ebp
movq (%r13), %rdi
addq %r15, %rdi
callq 0x39ec
cmpl %eax, %ebp
jge 0x31f8
testq %r14, %r14
jle 0x31f8
movq (%r13), %rax
leaq (%rax,%r15), %rsi
movabsq $-0x100000000, %rcx     # imm = 0xFFFFFFFF00000000
addq %rcx, %r12
leaq (%rax,%r15), %rdi
addq $0x50, %rdi
addq $-0x50, %r15
decq %r14
callq 0x33f6
jmp 0x31ae
sarq $0x20, %r12
imulq $0x50, %r12, %rdi
addq (%r13), %rdi
movq %rbx, %rsi
callq 0x33f6
movq %rbx, %rdi
callq 0x339e
movq 0x10(%rsp), %r14
incq %r14
movabsq $0x100000000, %rax      # imm = 0x100000000
movq (%rsp), %r12
addq %rax, %r12
movq 0x8(%rsp), %r15
addq $0x50, %r15
jmp 0x3175
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x324c
movq %rax, %rbx
leaq 0x18(%rsp), %rdi
callq 0x339e
movq %rbx, %rdi
callq 0x2330
// File: /workspace/github_cpp_makefile_star2_O2/TasnimAnas[P]Attendance-Management-System/src/StudentAdd.cpp
// Function: writeSorted()
void writeSorted()
{
    char filename[] = "Output/Student.txt";
    char binfilename[] = ".Data/input.bin";
    char binfileAttendance[] = ".Data/Attendance.bin";
    int garbage = remove(filename);
    garbage = remove(binfilename);
    garbage = remove(binfileAttendance);

    writeHeader();
    for (int i = 0; i < ::Student.size(); i++)
    {
        writeSl(i + 1);
        writeRoll(Student[i].getRoll());
        writeName(Student[i].getName());
        writeAttendance(i);
    }
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x20, %rsp
leaq 0x40ab(%rip), %rdi      # 0x7320
callq 0x2350
leaq 0x40bf(%rip), %rdi      # 0x7340
callq 0x2350
leaq 0x40c3(%rip), %rdi      # 0x7350
callq 0x2350
callq 0x4540
xorl %r15d, %r15d
leaq 0x7f57(%rip), %r12      # 0xb1f8
pushq $0x50
popq %r13
movq %rsp, %rbx
xorl %r14d, %r14d
movq 0x8(%r12), %rax
subq (%r12), %rax
cqto
idivq %r13
cmpq %r14, %rax
jbe 0x330a
incq %r14
movl %r14d, %edi
callq 0x461d
movq (%r12), %rdi
addq %r15, %rdi
callq 0x39ec
movl %eax, %edi
callq 0x4698
movq (%r12), %rsi
addq %r15, %rsi
movq %rbx, %rdi
callq 0x39f6
movq %rbx, %rdi
callq 0x477c
movq %rbx, %rdi
callq 0x20d0
leal -0x1(%r14), %edi
callq 0x4863
addq $0x50, %r15
jmp 0x32ab
addq $0x20, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
movq %rax, %rbx
movq %rsp, %rdi
callq 0x20d0
movq %rbx, %rdi
callq 0x2330
// File: /workspace/github_cpp_makefile_star2_O2/TasnimAnas[P]Attendance-Management-System/src/StudentClass.cpp
// Function: StudentClass::getTotalPresentDays()
int StudentClass::getTotalPresentDays()
{
    int present = 0;
    for (int i = 0; i < isPresent.size(); i++)
    {
        if (isPresent[i])
        {
            present++;
        }
    }
    return present;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
leaq 0x28(%rdi), %r14
xorl %r15d, %r15d
xorl %ebp, %ebp
movq 0x38(%rbx), %rax
movl 0x40(%rbx), %ecx
subq 0x28(%rbx), %rax
leaq (%rcx,%rax,8), %rax
cmpq %r15, %rax
jbe 0x3bc7
movq %r14, %rdi
movq %r15, %rsi
callq 0x3c12
andq (%rax), %rdx
cmpq $0x1, %rdx
sbbl $-0x1, %ebp
incq %r15
jmp 0x3b99
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/TasnimAnas[P]Attendance-Management-System/src/WelcomePage.cpp
// Function: welcomePage()
void welcomePage()
{
    cout << "Select option (1,2): ";
    int welcomePageSelection;
    cin >> welcomePageSelection;
    if (welcomePageSelection == 1)
    {
        system("CLS");
        logInPageHeader();
        logInPage();
    }
    else if (welcomePageSelection == 2)
    {
    }
    else
    {
        system("CLS");
        welcomePageHeader();
        cout << "Invalid selection! ";
        welcomePage();
    }
}

// Assembly:
pushq %rbx
subq $0x10, %rsp
movq 0x6bb0(%rip), %rdi      # 0xafd0
leaq 0x3062(%rip), %rsi      # 0x7489
callq 0x21d0
movq 0x6bad(%rip), %rdi      # 0xafe0
leaq 0xc(%rsp), %rbx
movq %rbx, %rsi
callq 0x2120
movl (%rbx), %eax
cmpl $0x2, %eax
je 0x4486
leaq 0x2dad(%rip), %rdi      # 0x71fb
cmpl $0x1, %eax
jne 0x4464
callq 0x2190
callq 0x5183
callq 0x4ee0
jmp 0x4486
callq 0x2190
callq 0x448c
movq 0x6b5b(%rip), %rdi      # 0xafd0
leaq 0x3023(%rip), %rsi      # 0x749f
callq 0x21d0
callq 0x4414
addq $0x10, %rsp
popq %rbx
retq
// File: /workspace/github_cpp_makefile_star2_O2/TasnimAnas[P]Attendance-Management-System/src/fileHandlers.cpp
// Function: writeHeader()
void writeHeader()
{
    ofstream writeStudent;
    writeStudent.open("Output/Student.txt", ios::app);
    writeStudent << setw(7) << "Serial";
    writeStudent << setw(14) << "Roll";
    writeStudent << setw(30) << "Name";
    writeStudent << setw(35) << "Attendance (Present/Total)" << endl
                 << endl;
    writeStudent.close();
}

// Assembly:
pushq %rbx
subq $0x200, %rsp            # imm = 0x200
movq %rsp, %rbx
movq %rbx, %rdi
callq 0x2310
leaq 0x2dc6(%rip), %rsi      # 0x7320
pushq $0x1
popq %rdx
movq %rbx, %rdi
callq 0x2030
movq %rsp, %rdi
movq (%rdi), %rax
movq -0x18(%rax), %rax
movq $0x7, 0x10(%rsp,%rax)
leaq 0x2bbe(%rip), %rsi      # 0x713d
callq 0x21d0
movq %rsp, %rdi
movq (%rdi), %rax
movq -0x18(%rax), %rax
movq $0xe, 0x10(%rsp,%rax)
leaq 0x2ba6(%rip), %rsi      # 0x7144
callq 0x21d0
movq %rsp, %rdi
movq (%rdi), %rax
movq -0x18(%rax), %rax
movq $0x1e, 0x10(%rsp,%rax)
leaq 0x2b8c(%rip), %rsi      # 0x7149
callq 0x21d0
movq %rsp, %rdi
movq (%rdi), %rax
movq -0x18(%rax), %rax
movq $0x23, 0x10(%rsp,%rax)
leaq 0x2b72(%rip), %rsi      # 0x714e
callq 0x21d0
movq %rax, %rdi
callq 0x20f0
movq %rax, %rdi
callq 0x20f0
movq %rsp, %rdi
callq 0x2270
movq %rsp, %rdi
callq 0x22a0
addq $0x200, %rsp            # imm = 0x200
popq %rbx
retq
movq %rax, %rbx
movq %rsp, %rdi
callq 0x22a0
movq %rbx, %rdi
callq 0x2330
// File: /workspace/github_cpp_makefile_star2_O2/TasnimAnas[P]Attendance-Management-System/src/fileHandlers.cpp
// Function: writeSl(int)
void writeSl(int sl)
{
    ofstream writeStudent;
    writeStudent.open("Output/Student.txt", ios::app);
    writeStudent << setw(7) << sl;
    writeStudent.close();
}

// Assembly:
pushq %r14
pushq %rbx
subq $0x208, %rsp            # imm = 0x208
movl %edi, %ebx
leaq 0x8(%rsp), %r14
movq %r14, %rdi
callq 0x2310
leaq 0x2ce3(%rip), %rsi      # 0x7320
pushq $0x1
popq %rdx
movq %r14, %rdi
callq 0x2030
leaq 0x8(%rsp), %rdi
movq (%rdi), %rax
movq -0x18(%rax), %rax
movq $0x7, 0x18(%rsp,%rax)
movl %ebx, %esi
callq 0x2320
leaq 0x8(%rsp), %rdi
callq 0x2270
leaq 0x8(%rsp), %rdi
callq 0x22a0
addq $0x208, %rsp            # imm = 0x208
popq %rbx
popq %r14
retq
movq %rax, %rbx
leaq 0x8(%rsp), %rdi
callq 0x22a0
movq %rbx, %rdi
callq 0x2330
// File: /workspace/github_cpp_makefile_star2_O2/TasnimAnas[P]Attendance-Management-System/src/fileHandlers.cpp
// Function: writeRoll(int)
void writeRoll(int roll)
{
    ofstream writeStudent;
    writeStudent.open("Output/Student.txt", ios::app);
    writeStudent << setw(14) << roll;
    writeStudent.close();

    ofstream writeStudentbin;
    writeStudentbin.open(".Data/input.bin", ios::app);
    writeStudentbin << roll << endl;
    writeStudentbin.close();
}

// Assembly:
pushq %r14
pushq %rbx
subq $0x408, %rsp            # imm = 0x408
movl %edi, %ebx
leaq 0x208(%rsp), %r14
movq %r14, %rdi
callq 0x2310
leaq 0x2c65(%rip), %rsi      # 0x7320
pushq $0x1
popq %rdx
movq %r14, %rdi
callq 0x2030
leaq 0x208(%rsp), %rdi
movq (%rdi), %rax
movq -0x18(%rax), %rax
movq $0xe, 0x218(%rsp,%rax)
movl %ebx, %esi
callq 0x2320
leaq 0x208(%rsp), %rdi
callq 0x2270
leaq 0x8(%rsp), %rdi
callq 0x2310
leaq 0x2c3a(%rip), %rsi      # 0x7340
leaq 0x8(%rsp), %rdi
pushq $0x1
popq %rdx
callq 0x2030
leaq 0x8(%rsp), %rdi
movl %ebx, %esi
callq 0x2320
movq %rax, %rdi
callq 0x20f0
leaq 0x8(%rsp), %rdi
callq 0x2270
leaq 0x8(%rsp), %rdi
callq 0x22a0
leaq 0x208(%rsp), %rdi
callq 0x22a0
addq $0x408, %rsp            # imm = 0x408
popq %rbx
popq %r14
retq
jmp 0x4755
movq %rax, %rbx
jmp 0x4767
movq %rax, %rbx
leaq 0x8(%rsp), %rdi
callq 0x22a0
leaq 0x208(%rsp), %rdi
callq 0x22a0
movq %rbx, %rdi
callq 0x2330
// File: /workspace/github_cpp_makefile_star2_O2/TasnimAnas[P]Attendance-Management-System/src/fileHandlers.cpp
// Function: writeName(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>)
void writeName(string name)
{
    ofstream writeStudent;
    writeStudent.open("Output/Student.txt", ios::app);
    writeStudent << setw(30) << name;
    writeStudent.close();

    ofstream writeStudentbin;
    writeStudentbin.open(".Data/input.bin", ios::app);
    writeStudentbin << name << endl;
    writeStudentbin.close();
}

// Assembly:
pushq %r14
pushq %rbx
subq $0x408, %rsp            # imm = 0x408
movq %rdi, %rbx
leaq 0x208(%rsp), %r14
movq %r14, %rdi
callq 0x2310
leaq 0x2b80(%rip), %rsi      # 0x7320
pushq $0x1
popq %rdx
movq %r14, %rdi
callq 0x2030
leaq 0x208(%rsp), %rdi
movq (%rdi), %rax
movq -0x18(%rax), %rax
movq $0x1e, 0x218(%rsp,%rax)
movq %rbx, %rsi
callq 0x21c0
leaq 0x208(%rsp), %rdi
callq 0x2270
leaq 0x8(%rsp), %rdi
callq 0x2310
leaq 0x2b54(%rip), %rsi      # 0x7340
leaq 0x8(%rsp), %rdi
pushq $0x1
popq %rdx
callq 0x2030
leaq 0x8(%rsp), %rdi
movq %rbx, %rsi
callq 0x21c0
movq %rax, %rdi
callq 0x20f0
leaq 0x8(%rsp), %rdi
callq 0x2270
leaq 0x8(%rsp), %rdi
callq 0x22a0
leaq 0x208(%rsp), %rdi
callq 0x22a0
addq $0x408, %rsp            # imm = 0x408
popq %rbx
popq %r14
retq
jmp 0x483c
movq %rax, %rbx
jmp 0x484e
movq %rax, %rbx
leaq 0x8(%rsp), %rdi
callq 0x22a0
leaq 0x208(%rsp), %rdi
callq 0x22a0
movq %rbx, %rdi
callq 0x2330
// File: /workspace/github_cpp_makefile_star2_O2/TasnimAnas[P]Attendance-Management-System/src/fileHandlers.cpp
// Function: AllReset()
void AllReset()
{
    char filename[] = "Output/Student.txt";
    char binfilename[] = ".Data/input.bin";
    char binfileAttendance[] = ".Data/Attendance.bin";
    int garbage = remove(filename);
    garbage = remove(binfilename);
    garbage = remove(binfileAttendance);
    for (int i = 0; i < Student.size(); i++)
    {
        Student.pop_back();
    }
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
leaq 0x2611(%rip), %rdi      # 0x7320
callq 0x2350
leaq 0x2625(%rip), %rdi      # 0x7340
callq 0x2350
leaq 0x2629(%rip), %rdi      # 0x7350
callq 0x2350
xorl %r14d, %r14d
leaq 0x64c2(%rip), %rbx      # 0xb1f8
pushq $0x50
popq %r15
movq 0x8(%rbx), %rax
subq (%rbx), %rax
cqto
idivq %r15
cmpq %r14, %rax
jbe 0x4d58
movq %rbx, %rdi
callq 0x4d84
incq %r14
jmp 0x4d3a
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O2/TasnimAnas[P]Attendance-Management-System/src/main.cpp
// Function: main
int main()
{
    system("CLS");
    welcomePageHeader();
    welcomePage();
    return 0;
}

// Assembly:
pushq %rax
leaq 0x1feb(%rip), %rdi      # 0x71fb
callq 0x2190
callq 0x448c
callq 0x4414
xorl %eax, %eax
popq %rcx
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/TasnimAnas[P]Attendance-Management-System/src/takeAttendance.cpp
// Function: monthName[abi:cxx11](int)
string monthName(int month)
{
    switch (month)
    {
    case 1:
        return "January";
    case 2:
        return "February";
    case 3:
        return "March";
    case 4:
        return "April";
    case 5:
        return "May";
    case 6:
        return "June";
    case 7:
        return "July";
    case 8:
        return "August";
    case 9:
        return "September";
    case 10:
        return "October";
    case 11:
        return "November";
    case 12:
        return "December";
    }
}

// Assembly:
pushq %rbx
subq $0x10, %rsp
movq %rdi, %rbx
decl %esi
leaq 0x163f(%rip), %rax      # 0x772c
movslq (%rax,%rsi,4), %rcx
addq %rax, %rcx
jmpq *%rcx
leaq 0x176c(%rip), %rsi      # 0x7869
leaq 0xf(%rsp), %rdx
jmp 0x61a2
leaq 0x17a8(%rip), %rsi      # 0x78b6
leaq 0x4(%rsp), %rdx
jmp 0x61a2
leaq 0x1767(%rip), %rsi      # 0x7886
leaq 0xb(%rsp), %rdx
jmp 0x61a2
leaq 0x1778(%rip), %rsi      # 0x78a5
leaq 0x6(%rsp), %rdx
jmp 0x61a2
leaq 0x173f(%rip), %rsi      # 0x787a
leaq 0xd(%rsp), %rdx
jmp 0x61a2
leaq 0x1737(%rip), %rsi      # 0x7880
leaq 0xc(%rsp), %rdx
jmp 0x61a2
leaq 0x173d(%rip), %rsi      # 0x7894
leaq 0x8(%rsp), %rdx
jmp 0x61a2
leaq 0x170c(%rip), %rsi      # 0x7871
leaq 0xe(%rsp), %rdx
jmp 0x61a2
leaq 0x1717(%rip), %rsi      # 0x788a
leaq 0xa(%rsp), %rdx
jmp 0x61a2
leaq 0x170e(%rip), %rsi      # 0x788f
leaq 0x9(%rsp), %rdx
jmp 0x61a2
leaq 0x171e(%rip), %rsi      # 0x78ad
leaq 0x5(%rsp), %rdx
jmp 0x61a2
leaq 0x16fe(%rip), %rsi      # 0x789b
leaq 0x7(%rsp), %rdx
movq %rbx, %rdi
callq 0x2860
movq %rbx, %rax
addq $0x10, %rsp
popq %rbx
retq
// File: /workspace/github_cpp_makefile_star2_O2/neguse[P]no/lang.cc
// Function: main
int main(int argc, char **argv) {
  if (argc != 2) {
    printf("Usage: ./no <program>\n");
    return 1;
  }

  Input input(argv[1]);
  if (!input.ok()) {
    printf("failed to open file\n");
    return 2;
  }

  char c;
  int level = 0;
  Lang l;

  auto n = l.Parse(input);
  // l.Print(n);
  if (!l.Validate(n)) {
    return 3;
  }

  auto i = LangInterpreter();
  i.Exec(n);

  return 0;
}

// Assembly:
pushq %rbx
subq $0x80, %rsp
cmpl $0x2, %edi
jne 0x23bf
movq 0x8(%rsi), %rdi
leaq 0x4f6e(%rip), %rsi      # 0x7296
callq 0x2120
movq %rax, 0x40(%rsp)
movq $0x1, 0x48(%rsp)
testq %rax, %rax
je 0x23cf
leaq 0x50(%rsp), %rbx
movq %rbx, %rdi
callq 0x243a
leaq 0x10(%rsp), %rdi
leaq 0x40(%rsp), %rdx
movq %rbx, %rsi
callq 0x30e6
leaq 0x30(%rsp), %rbx
leaq 0x10(%rsp), %rsi
movq %rbx, %rdi
callq 0x4312
leaq 0x50(%rsp), %rdi
movq %rbx, %rsi
callq 0x3164
movl %eax, %ebx
leaq 0x38(%rsp), %rdi
callq 0x40c8
testb %bl, %bl
je 0x23e0
leaq 0x20(%rsp), %rbx
leaq 0x10(%rsp), %rsi
movq %rbx, %rdi
callq 0x4312
leaq 0xf(%rsp), %rdi
movq %rbx, %rsi
callq 0x31e8
leaq 0x28(%rsp), %rdi
callq 0x40c8
xorl %ebx, %ebx
jmp 0x23e3
leaq 0x4f3d(%rip), %rdi      # 0x7303
callq 0x2180
pushq $0x1
jmp 0x23dd
leaq 0x4f19(%rip), %rdi      # 0x72ef
callq 0x2180
pushq $0x2
popq %rbx
jmp 0x23f7
pushq $0x3
popq %rbx
leaq 0x18(%rsp), %rdi
callq 0x40c8
leaq 0x50(%rsp), %rdi
callq 0x3c0e
movl %ebx, %eax
addq $0x80, %rsp
popq %rbx
retq
movq %rax, %rbx
leaq 0x28(%rsp), %rdi
jmp 0x2414
movq %rax, %rbx
leaq 0x38(%rsp), %rdi
callq 0x40c8
leaq 0x18(%rsp), %rdi
callq 0x40c8
jmp 0x2428
movq %rax, %rbx
leaq 0x50(%rsp), %rdi
callq 0x3c0e
movq %rbx, %rdi
callq 0x21c0
// File: /workspace/github_cpp_makefile_star2_O2/neguse[P]no/lang.cc
// Function: Lang::Parse(Input&)
Node::Ref Parse(Input &input) {
    auto n = ParseNode(input);
    auto e = ParseNode(input);
    assert(e == nullptr);
    return n;
  }

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x10, %rsp
movq %rdx, %r14
movq %rsi, %r15
movq %rdi, %rbx
xorl %ecx, %ecx
callq 0x3c58
movq %rsp, %rdi
movq %r15, %rsi
movq %r14, %rdx
xorl %ecx, %ecx
callq 0x3c58
cmpq $0x0, (%rsp)
jne 0x312d
leaq 0x8(%rsp), %rdi
callq 0x40c8
movq %rbx, %rax
addq $0x10, %rsp
popq %rbx
popq %r14
popq %r15
retq
leaq 0x3f75(%rip), %rdi      # 0x70a9
leaq 0x3f7b(%rip), %rsi      # 0x70b6
leaq 0x3f7c(%rip), %rcx      # 0x70be
movl $0x115, %edx            # imm = 0x115
callq 0x20b0
movq %rax, %r14
addq $0x8, %rbx
movq %rbx, %rdi
callq 0x40c8
movq %r14, %rdi
callq 0x21c0
nop
// File: /workspace/github_cpp_makefile_star2_O2/neguse[P]no/lang.cc
// Function: Lang::ParseNode(Input&, int)
Node::Ref ParseNode(Input &input, int level = 0) {
    char c;
    for (;;) {
      c = input.Get();
      // skip space
      if (c == ' ' || c == '\t' || c == '\n') {
        continue;
      } else if (c == EOF) {
        return nullptr;
      }
      break;
    }

    assert(syntax_.find(c) != syntax_.end());

    auto syntax = syntax_[c];
    auto n = std::make_shared<Node>(Node{c});
    n->st = syntax.st;
    n->pos = input.pos();
    if (syntax.ht == HierarchicalType::Parent) {
      n->a = this->ParseNode(input, level + 1);
      n->d = this->ParseNode(input, level + 1);
    }
    return n;
  }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x80, %rsp
movl %ecx, %ebp
movq %rdx, %r14
movq %rsi, %r15
movq %rdi, %rbx
movabsq $0x100000600, %r12      # imm = 0x100000600
movq %r14, %rdi
callq 0x3dec
movzbl %al, %ecx
cmpb $0x20, %al
ja 0x3c91
btq %rcx, %r12
jb 0x3c7c
cmpl $0xff, %ecx
jne 0x3ca4
xorps %xmm0, %xmm0
movups %xmm0, (%rbx)
jmp 0x3d88
leaq 0xf(%rsp), %rsi
movb %al, (%rsi)
movq %r15, %rdi
callq 0x3ea6
leaq 0x8(%r15), %rcx
cmpq %rcx, %rax
je 0x3d9b
leaq 0xf(%rsp), %r12
movq %r15, %rdi
movq %r12, %rsi
callq 0x368e
leaq 0x48(%rsp), %rdi
movq %rax, %rsi
callq 0x3e20
movb (%r12), %al
leaq 0x10(%rsp), %rsi
movb %al, (%rsi)
xorps %xmm0, %xmm0
movups %xmm0, 0x8(%rsi)
movups %xmm0, 0x18(%rsi)
movups %xmm0, 0x24(%rsi)
movq %rbx, %rdi
callq 0x3e6d
leaq 0x10(%rsp), %rdi
callq 0x3e8c
movl 0x4c(%rsp), %eax
movq (%rbx), %rcx
movl %eax, 0x30(%rcx)
movq 0x8(%r14), %rax
movq %rax, 0x28(%rcx)
cmpl $0x1, 0x48(%rsp)
jne 0x3d7e
incl %ebp
leaq 0x10(%rsp), %rdi
movq %r15, %rsi
movq %r14, %rdx
movl %ebp, %ecx
callq 0x3c58
movq (%rbx), %rdi
addq $0x8, %rdi
leaq 0x10(%rsp), %rsi
callq 0x409a
leaq 0x18(%rsp), %rdi
callq 0x40c8
leaq 0x10(%rsp), %rdi
movq %r15, %rsi
movq %r14, %rdx
movl %ebp, %ecx
callq 0x3c58
movq (%rbx), %rdi
addq $0x18, %rdi
leaq 0x10(%rsp), %rsi
callq 0x409a
leaq 0x18(%rsp), %rdi
callq 0x40c8
leaq 0x48(%rsp), %rdi
callq 0x3714
movq %rbx, %rax
addq $0x80, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
leaq 0x333b(%rip), %rdi      # 0x70dd
leaq 0x330d(%rip), %rsi      # 0x70b6
leaq 0x334e(%rip), %rcx      # 0x70fe
movl $0x125, %edx            # imm = 0x125
callq 0x20b0
jmp 0x3dbc
movq %rax, %r14
addq $0x8, %rbx
movq %rbx, %rdi
callq 0x40c8
jmp 0x3dda
movq %rax, %r14
leaq 0x10(%rsp), %rdi
callq 0x3e8c
leaq 0x48(%rsp), %rdi
callq 0x3714
movq %r14, %rdi
callq 0x21c0
// File: /workspace/github_cpp_makefile_star2_O2/neguse[P]no/lang.cc
// Function: Input::Get()
char Get() {
    char c = fgetc(fp_);
    if (c == '\n') {
      pos_.line++;
      pos_.col = 0;
    } else if (c == '\t') {
      pos_.col += 4;
    } else if (c == EOF) {
    } else {
      pos_.col++;
    }
    return c;
  }

// Assembly:
pushq %rbx
movq %rdi, %rbx
movq (%rdi), %rdi
callq 0x2190
cmpb $0x9, %al
je 0x3e15
movzbl %al, %ecx
cmpl $0xff, %ecx
je 0x3e1e
cmpl $0xa, %ecx
jne 0x3e1b
incl 0x8(%rbx)
andl $0x0, 0xc(%rbx)
jmp 0x3e1e
addl $0x4, 0xc(%rbx)
jmp 0x3e1e
incl 0xc(%rbx)
popq %rbx
retq
// File: /workspace/github_cpp_makefile_star2_O2/neguse[P]no/lang.cc
// Function: Lang::ValidateNode(std::shared_ptr<Node>, std::vector<SyntaxType, std::allocator<SyntaxType>>)
bool ValidateNode(Node::Ref n, AcceptableSyntax as) {
    // validate current node
    bool valid = false;
    auto syntax = syntax_[n->c];
    for (auto asi : as) {
      if (asi == syntax.st) {
        valid = true;
      }
    }
    if (!valid) {
      printf("failed to validate at %c (%d,%d)\n", n->c, n->pos.line,
             n->pos.col);
      printf("must be either ");
      for (auto asi : as) {
        printf("%d ", asi);
      }
      printf("\n");
      return false;
    }

    // validate child node
    if (n->a) {
      if (!ValidateNode(n->a, syntax.aa)) {
        return false;
      }
    }
    if (n->d) {
      if (!ValidateNode(n->d, syntax.ad)) {
        return false;
      }
    }
    return true;
  }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x88, %rsp
movq %rdx, %r12
movq %rsi, %r14
movq %rdi, %rbx
movq (%rsi), %rsi
callq 0x368e
leaq 0x50(%rsp), %r15
movq %r15, %rdi
movq %rax, %rsi
callq 0x3e20
movq (%r12), %rax
movq 0x8(%r12), %rcx
movl 0x4(%r15), %edx
leaq 0x18(%rsp), %r15
leaq 0x8(%rsp), %r13
xorl %edi, %edi
cmpq %rcx, %rax
je 0x41a3
cmpl %edx, (%rax)
sete %sil
orb %sil, %dil
addq $0x4, %rax
jmp 0x418f
movq (%r14), %rsi
testb $0x1, %dil
je 0x4258
cmpq $0x0, 0x8(%rsi)
je 0x4208
addq $0x8, %rsi
leaq 0x10(%rsp), %rdi
callq 0x4312
leaq 0x58(%rsp), %rsi
leaq 0x38(%rsp), %rdi
callq 0x3640
leaq 0x10(%rsp), %rsi
leaq 0x38(%rsp), %rdx
movq %rbx, %rdi
callq 0x4144
movl %eax, %ebp
leaq 0x38(%rsp), %rdi
callq 0x37e4
leaq 0x18(%rsp), %rdi
callq 0x40c8
testb %bpl, %bpl
je 0x42af
movq (%r14), %rsi
cmpq $0x0, 0x18(%rsi)
je 0x4254
addq $0x18, %rsi
movq %rsp, %rdi
callq 0x4312
leaq 0x70(%rsp), %rsi
leaq 0x20(%rsp), %rdi
callq 0x3640
movq %rsp, %rsi
leaq 0x20(%rsp), %rdx
movq %rbx, %rdi
callq 0x4144
movl %eax, %ebx
leaq 0x20(%rsp), %rdi
callq 0x37e4
leaq 0x8(%rsp), %rdi
callq 0x40c8
testb %bl, %bl
je 0x42af
movb $0x1, %bl
jmp 0x42b1
movsbl (%rsi), %eax
movl 0x28(%rsi), %edx
movl 0x2c(%rsi), %ecx
leaq 0x2ebe(%rip), %rdi      # 0x7126
movl %eax, %esi
xorl %eax, %eax
callq 0x2030
leaq 0x2ed0(%rip), %rdi      # 0x7148
xorl %eax, %eax
callq 0x2030
movq (%r12), %r14
movq 0x8(%r12), %r15
leaq 0x2ec9(%rip), %rbx      # 0x7158
cmpq %r15, %r14
je 0x42a7
movl (%r14), %esi
movq %rbx, %rdi
xorl %eax, %eax
callq 0x2030
addq $0x4, %r14
jmp 0x428f
pushq $0xa
popq %rdi
callq 0x2140
xorl %ebx, %ebx
leaq 0x50(%rsp), %rdi
callq 0x3714
movl %ebx, %eax
addq $0x88, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
leaq 0x20(%rsp), %rdi
callq 0x37e4
jmp 0x42e1
movq %rax, %rbx
movq %r13, %r15
jmp 0x42f8
movq %rax, %rbx
leaq 0x38(%rsp), %rdi
callq 0x37e4
jmp 0x42f8
movq %rax, %rbx
movq %r15, %rdi
callq 0x40c8
leaq 0x50(%rsp), %rdi
callq 0x3714
movq %rbx, %rdi
callq 0x21c0
// File: /workspace/github_cpp_makefile_star2_O2/neguse[P]no/lang.cc
// Function: LangInterpreter::Frame::Set(char, std::shared_ptr<LangInterpreter::Value>)
void Set(char c, std::shared_ptr<Value> v) {
      auto it = m.find(c);
      if (it != m.end()) {
        it->second = v;
      } else {
        if (parent == nullptr) {
          m[c] = v;
        } else {
          parent->Set(c, v);
        }
      }
    }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x18, %rsp
movq %rdx, %rbx
movq %rdi, %r15
leaq 0x7(%rsp), %rax
movb %sil, (%rax)
leaq 0x10(%rdi), %r14
movq %r14, %rdi
movq %rax, %rsi
callq 0x5860
leaq 0x18(%r15), %rcx
cmpq %rcx, %rax
je 0x4405
addq $0x28, %rax
movq %rax, %rdi
movq %rbx, %rsi
callq 0x58b2
jmp 0x4439
movq (%r15), %r15
testq %r15, %r15
je 0x4444
movsbl 0x7(%rsp), %ebp
leaq 0x8(%rsp), %r14
movq %r14, %rdi
movq %rbx, %rsi
callq 0x5b28
movq %r15, %rdi
movl %ebp, %esi
movq %r14, %rdx
callq 0x43c4
leaq 0x10(%rsp), %rdi
callq 0x40c8
addq $0x18, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
leaq 0x7(%rsp), %rsi
movq %r14, %rdi
callq 0x5812
jmp 0x43f8
movq %rax, %rbx
leaq 0x10(%rsp), %rdi
callq 0x40c8
movq %rbx, %rdi
callq 0x21c0
// File: /workspace/github_cpp_makefile_star2_O2/neguse[P]no/lang.cc
// Function: LangInterpreter::ReadI()
Value::Ref ReadI() {
    int i = 0;
    std::cin >> i;
    Value::Ref v = std::make_shared<Value>();
    v->SetInteger(i);
    return v;
  }

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
leaq 0x4(%rsp), %r14
andl $0x0, (%r14)
movq 0x540d(%rip), %rdi      # 0xafe0
movq %r14, %rsi
callq 0x20a0
movq %rbx, %rdi
callq 0x4361
movq (%rbx), %rax
movl (%r14), %ecx
andl $0x0, (%rax)
movl %ecx, 0x8(%rax)
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_cpp_makefile_star2_O2/neguse[P]no/lang.cc
// Function: LangInterpreter::ReadS()
Value::Ref ReadS() {
    std::string s;
    std::cin >> s;
    Value::Ref v = StringToList(s.c_str());
    return v;
  }

// Assembly:
pushq %r14
pushq %rbx
subq $0x28, %rsp
movq %rsi, %r14
movq %rdi, %rbx
leaq 0x18(%rsp), %rax
movq %rax, -0x10(%rax)
andq $0x0, -0x8(%rax)
movb $0x0, (%rax)
movq 0x53c1(%rip), %rdi      # 0xafe0
leaq 0x8(%rsp), %rsi
callq 0x2130
movq 0x8(%rsp), %rdx
movq %rbx, %rdi
movq %r14, %rsi
callq 0x5dea
leaq 0x8(%rsp), %rdi
callq 0x2080
movq %rbx, %rax
addq $0x28, %rsp
popq %rbx
popq %r14
retq
movq %rax, %rbx
leaq 0x8(%rsp), %rdi
callq 0x2080
movq %rbx, %rdi
callq 0x21c0
nop
// File: /workspace/github_cpp_makefile_star2_O2/neguse[P]no/lang.cc
// Function: LangInterpreter::Value::True()
bool True() {
      switch (kind) {
      case ValueKind::Integer:
        return v.i != 0;
      case ValueKind::List:
        return v.c != nullptr;
      case ValueKind::Closure:
        return v.l != nullptr;
      }
      assert(0);
      return false;
    }

// Assembly:
movl (%rdi), %eax
cmpl $0x2, %eax
je 0x5d19
cmpl $0x1, %eax
je 0x5d12
testl %eax, %eax
jne 0x5d22
cmpl $0x0, 0x8(%rdi)
jmp 0x5d1e
cmpq $0x0, 0x20(%rdi)
jmp 0x5d1e
cmpq $0x0, 0x10(%rdi)
setne %al
retq
pushq %rax
leaq 0x14ba(%rip), %rdi      # 0x71e4
leaq 0x1385(%rip), %rsi      # 0x70b6
leaq 0x158f(%rip), %rcx      # 0x72c7
movl $0x1d2, %edx            # imm = 0x1D2
callq 0x20b0
// File: /workspace/github_cpp_makefile_star2_O2/neguse[P]no/lang.cc
// Function: LangInterpreter::Frame::Get(char) const
std::shared_ptr<Value> Get(char c) const {
      auto it = m.find(c);
      if (it != m.end()) {
        return it->second;
      } else if (parent != nullptr) {
        return parent->Get(c);
      } else {
        return nullptr;
      }
    }

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %r14
movq %rdi, %rbx
leaq 0x7(%rsp), %rsi
movb %dl, (%rsi)
leaq 0x10(%r14), %rdi
callq 0x6164
leaq 0x18(%r14), %rcx
cmpq %rcx, %rax
je 0x5d76
addq $0x28, %rax
movq %rbx, %rdi
movq %rax, %rsi
callq 0x5b28
jmp 0x5d93
movq (%r14), %rsi
testq %rsi, %rsi
je 0x5d8d
movsbl 0x7(%rsp), %edx
movq %rbx, %rdi
callq 0x5d42
jmp 0x5d93
xorps %xmm0, %xmm0
movups %xmm0, (%rbx)
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_cpp_makefile_star2_O2/neguse[P]no/lang.cc
// Function: LangInterpreter::StringToList(char const*)
Value::Ref StringToList(const char *s) {
    if (*s == '\0') {
      Value::Ref v = std::make_shared<Value>();
      v->SetList(nullptr);
      return v;
    } else {
      Value::Ref v = std::make_shared<Value>();
      Cons::Ref c = std::make_shared<Cons>();
      Value::Ref vi = std::make_shared<Value>();
      vi->SetInteger(*s);
      c->car = vi;
      c->cdr = StringToList(s + 1);
      v->SetList(c);
      return v;
    }
  }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x50, %rsp
movq %rdx, %r14
movq %rsi, %r15
movq %rdi, %rbx
movb (%rdx), %bpl
callq 0x4361
testb %bpl, %bpl
je 0x5ea7
movq %rsp, %rdi
callq 0x5f09
leaq 0x10(%rsp), %rdi
callq 0x4361
leaq 0x10(%rsp), %rsi
movq (%rsi), %rax
movsbl (%r14), %ecx
andl $0x0, (%rax)
movl %ecx, 0x8(%rax)
movq (%rsp), %rdi
callq 0x58b2
incq %r14
leaq 0x20(%rsp), %rdi
movq %r15, %rsi
movq %r14, %rdx
callq 0x5dea
movq %rsp, %r14
movq (%r14), %rdi
addq $0x10, %rdi
leaq 0x20(%rsp), %rsi
callq 0x6052
leaq 0x28(%rsp), %rdi
callq 0x40c8
movq (%rbx), %r15
leaq 0x40(%rsp), %r12
movq %r12, %rdi
movq %r14, %rsi
callq 0x6150
movq %r15, %rdi
movq %r12, %rsi
callq 0x4468
leaq 0x48(%rsp), %rdi
callq 0x40c8
leaq 0x18(%rsp), %rdi
callq 0x40c8
leaq 0x8(%rsp), %rdi
jmp 0x5ebf
movq (%rbx), %rdi
xorps %xmm0, %xmm0
leaq 0x30(%rsp), %rsi
movaps %xmm0, (%rsi)
callq 0x4468
leaq 0x38(%rsp), %rdi
callq 0x40c8
movq %rbx, %rax
addq $0x50, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %r14
leaq 0x18(%rsp), %rdi
callq 0x40c8
jmp 0x5ee6
movq %rax, %r14
leaq 0x8(%rsp), %rdi
callq 0x40c8
jmp 0x5ef5
movq %rax, %r14
addq $0x8, %rbx
movq %rbx, %rdi
callq 0x40c8
movq %r14, %rdi
callq 0x21c0
// File: /workspace/github_cpp_makefile_star2_O2/superblocks[P]superblocks/set-dmd.cpp
// Function: Superblocks::init()
void Superblocks::init() {

	coin = "DMD"; 
	coin_name = "Diamondcoin";

	hash_length = 64;

	// normal (step 0)
	reward[0] = 1;

	// superblocks

	seed_type[1] = SEED_WITH_PREVIOUS_BLOCK_HASH;
	cutout_start[1] = 6;
	cutout_length[1] = 7;
	rnd_range_low[1] = 1;
	rnd_range_high[1] = 14400;
	luck_type[1] = LUCK_WITH_MORE_THAN_X_AND_LESS_THAN_Y;
	luck_x[1] = 10000;
	luck_y[1] = 10011;
	reward[1] = 30;

	luck_type[2] = LUCK_WITH_MORE_THAN_X_AND_LESS_THAN_Y;
	luck_x[2] = 2000;
	luck_y[2] = 2031;
	reward[2] = 8;

	luck_type[3] = LUCK_WITH_MORE_THAN_X_AND_LESS_THAN_Y;
	luck_x[3] = 8000;
	luck_y[3] = 8101;
	reward[3] = 2;

}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
movq %rdi, %rbx
addq $0x18, %rdi
leaq 0x1c28(%rip), %rsi      # 0x3e80
callq 0x1140
leaq 0x38(%rbx), %rdi
leaq 0x1c1c(%rip), %rsi      # 0x3e84
callq 0x1140
movl $0x40, 0x58(%rbx)
movabsq $0x1e00000001, %rax     # imm = 0x1E00000001
movq %rax, 0x14c(%rbx)
movl $0x2, 0x60(%rbx)
movl $0x6, 0x70(%rbx)
movl $0x7, 0x80(%rbx)
movl $0x1, 0x90(%rbx)
movl $0x3840, 0xa0(%rbx)     # imm = 0x3840
movl $0x3, 0x120(%rbx)
movl $0x2710, 0x130(%rbx)    # imm = 0x2710
movl $0x271b, 0x140(%rbx)    # imm = 0x271B
movabsq $0x300000003, %rax      # imm = 0x300000003
movq %rax, 0x124(%rbx)
movabsq $0x1f40000007d0, %rax   # imm = 0x1F40000007D0
movq %rax, 0x134(%rbx)
movabsq $0x1fa5000007ef, %rax   # imm = 0x1FA5000007EF
movq %rax, 0x144(%rbx)
movabsq $0x200000008, %rax      # imm = 0x200000008
movq %rax, 0x154(%rbx)
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/tomfunkhouser[P]gaps/pkgs/R3Utils/R3Segmentation.cpp
// Function: gaps::R3SegmentationPrimitive::Distance(gaps::R3Point const&) const
RNLength R3SegmentationPrimitive::
Distance(const R3Point& position) const
{
  // Return distance from primitive to point
  if (primitive_type == R3_SEGMENTATION_POINT_PRIMITIVE_TYPE) return R3Distance(centroid, position);
  else if (primitive_type == R3_SEGMENTATION_LINE_PRIMITIVE_TYPE) return R3Distance(line, position);
  else if (primitive_type == R3_SEGMENTATION_PLANE_PRIMITIVE_TYPE) return R3Distance(plane, position);
#if 0
  else if (primitive_type == R3_SEGMENTATION_PLANAR_GRID_PRIMITIVE_TYPE) {
    R2R3SegmentationPoint grid_position = planar_grid.GridPosition(position);
    int ix = (int) (grid_position.X() + 0.5);
    if ((ix < 0) || (ix >= planar_grid.XResolution())) return RN_INFINITY;
    int iy = (int) (grid_position.Y() + 0.5);
    if ((iy < 0) || (iy >= planar_grid.YResolution())) return RN_INFINITY;
    RNScalar value = planar_grid.GridValue(ix, iy);
    if (value <= 0) return RN_INFINITY;
    return R3Distance(planar_grid.Plane(), position);
  }
#endif
  else {
    RNAbort("Unrecognized primitive type");
    return RN_INFINITY;
  }

// Assembly:
movq %rdi, %rax
movl (%rdi), %ecx
cmpl $0x3, %ecx
je 0x27947
cmpl $0x2, %ecx
je 0x27938
cmpl $0x1, %ecx
jne 0x27958
addq $0x40, %rax
movq %rax, %rdi
jmp 0x60e7a
addq $0x58, %rax
movq %rsi, %rdi
movq %rax, %rsi
jmp 0x60ea0
addq $0x88, %rax
movq %rsi, %rdi
movq %rax, %rsi
jmp 0x61036
pushq %rax
leaq 0xc78c0(%rip), %rdi     # 0xef220
xorl %eax, %eax
callq 0xb4478
leaq 0x13440a(%rip), %rax    # 0x15bd78
movsd (%rax), %xmm0
popq %rax
retq
// File: /workspace/github_cpp_makefile_star2_O2/tomfunkhouser[P]gaps/pkgs/R3Utils/R3Segmentation.cpp
// Function: gaps::R3SegmentationPrimitive::Update(gaps::R3Point const&)
void R3SegmentationPrimitive::
Update(const R3Point& point)
{
  // Set everything
  primitive_type = R3_SEGMENTATION_POINT_PRIMITIVE_TYPE;
  this->centroid = point;
  line = R3null_line;
  plane = R3null_plane;
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
movl $0x1, (%rdi)
addq $0x40, %rdi
callq 0x9067a
leaq 0x58(%rbx), %rdi
leaq 0x535e4e(%rip), %rsi    # 0x55d7e0
callq 0x2c19c
addq $0x88, %rbx
leaq 0x535bbb(%rip), %rsi    # 0x55d560
movq %rbx, %rdi
popq %rbx
jmp 0x2c1c6
// File: /workspace/github_cpp_makefile_star2_O2/tomfunkhouser[P]gaps/pkgs/R3Utils/R3Segmentation.cpp
// Function: gaps::R3SegmentationPrimitive::Update(gaps::R3Line const&)
void R3SegmentationPrimitive::
Update(const R3Line& line)
{
  // Set everything
  primitive_type = R3_SEGMENTATION_LINE_PRIMITIVE_TYPE;
  centroid = R3zero_point;
  centroid.Project(line);
  this->line = line;
  plane = R3null_plane;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rsi, %rbx
movq %rdi, %r14
movl $0x2, (%rdi)
leaq 0x40(%rdi), %r15
leaq 0x535f66(%rip), %rsi    # 0x55d930
movq %r15, %rdi
callq 0x9067a
movq %r15, %rdi
movq %rbx, %rsi
callq 0x90598
leaq 0x58(%r14), %rdi
movq %rbx, %rsi
callq 0x2c19c
addq $0x88, %r14
leaq 0x535b69(%rip), %rsi    # 0x55d560
movq %r14, %rdi
popq %rbx
popq %r14
popq %r15
jmp 0x2c1c6
// File: /workspace/github_cpp_makefile_star2_O2/tomfunkhouser[P]gaps/pkgs/R3Utils/R3Segmentation.cpp
// Function: gaps::R3SegmentationPrimitive::Update(gaps::R3Plane const&)
void R3SegmentationPrimitive::
Update(const R3Plane& plane)
{
  // Set everything
  primitive_type = R3_SEGMENTATION_PLANE_PRIMITIVE_TYPE;
  centroid = R3zero_point;
  centroid.Project(plane);
  line = R3null_line;
  this->plane = plane;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rsi, %rbx
movq %rdi, %r14
movl $0x3, (%rdi)
leaq 0x40(%rdi), %r15
leaq 0x535f10(%rip), %rsi    # 0x55d930
movq %r15, %rdi
callq 0x9067a
movq %r15, %rdi
movq %rbx, %rsi
callq 0x9069a
leaq 0x58(%r14), %rdi
leaq 0x535da2(%rip), %rsi    # 0x55d7e0
callq 0x2c19c
addq $0x88, %r14
movq %r14, %rdi
movq %rbx, %rsi
popq %rbx
popq %r14
popq %r15
jmp 0x2c1c6
// File: /workspace/github_cpp_makefile_star2_O2/tomfunkhouser[P]gaps/pkgs/R3Utils/R3Segmentation.cpp
// Function: gaps::R3SegmentationCluster::R3SegmentationCluster(gaps::R3SegmentationPoint*, int)
R3SegmentationCluster::
R3SegmentationCluster(R3SegmentationPoint *seed_point, int primitive_type)
  : seed_point(seed_point),
    points(),
    parent(NULL),
    children(),
    pairs(),
    primitive(primitive_type),
    area(0),
    color(0,0,0),
    timestamp(0),
    category_identifier(-1),
    category_confidence(0),
    possible_affinity(0),
    total_affinity(0),
    segmentation(NULL),
    segmentation_index(-1)
{
  // Update primitive and color and area
  if (seed_point) primitive.Update(seed_point);
  if (seed_point) color = seed_point->color;
  if (seed_point) timestamp = seed_point->timestamp;
  if (seed_point) area = seed_point->area;
  if (seed_point) category_identifier = seed_point->category_identifier;
  if (seed_point) category_confidence = seed_point->category_confidence;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %edx, %ebx
movq %rsi, %r12
movq %rdi, %r15
movq %rsi, (%rdi)
addq $0x8, %rdi
movq %rdi, (%rsp)
callq 0xb1eda
andq $0x0, 0x18(%r15)
leaq 0x20(%r15), %r14
movq %r14, %rdi
callq 0xb1eda
leaq 0x30(%r15), %r13
movq %r13, %rdi
callq 0xb1eda
leaq 0x40(%r15), %rbp
movq %rbp, %rdi
movl %ebx, %esi
callq 0x272bc
andq $0x0, 0xe8(%r15)
leaq 0xf0(%r15), %rbx
xorps %xmm0, %xmm0
xorps %xmm1, %xmm1
xorps %xmm2, %xmm2
movq %rbx, %rdi
callq 0xb1d52
andq $0x0, 0x108(%r15)
orl $-0x1, 0x110(%r15)
xorps %xmm0, %xmm0
movups %xmm0, 0x118(%r15)
movups %xmm0, 0x128(%r15)
orl $-0x1, 0x138(%r15)
testq %r12, %r12
je 0x27ebc
movq %rbp, %rdi
movq %r12, %rsi
xorl %edx, %edx
callq 0x2741c
leaq 0x78(%r12), %rsi
movq %rbx, %rdi
callq 0xb1de2
movsd 0x68(%r12), %xmm0
movsd %xmm0, 0x108(%r15)
movsd 0x70(%r12), %xmm0
movsd %xmm0, 0xe8(%r15)
movl 0x90(%r12), %eax
movl %eax, 0x110(%r15)
movsd 0x98(%r12), %xmm0
movsd %xmm0, 0x118(%r15)
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %r12
jmp 0x27ee9
movq %rax, %r12
jmp 0x27ef1
movq %rax, %r12
jmp 0x27ef9
movq %rax, %r12
addq $0x48, %r15
movq %r15, %rdi
callq 0x7cbba
movq %r13, %rdi
callq 0xb1f48
movq %r14, %rdi
callq 0xb1f48
movq (%rsp), %rdi
callq 0xb1f48
movq %r12, %rdi
callq 0x15af0
// File: /workspace/github_cpp_makefile_star2_O2/tomfunkhouser[P]gaps/pkgs/R3Utils/R3Segmentation.cpp
// Function: gaps::R3SegmentationCluster::R3SegmentationCluster(gaps::R3SegmentationPoint*, gaps::R3SegmentationPrimitive const&)
R3SegmentationCluster::
R3SegmentationCluster(R3SegmentationPoint *seed_point, const R3SegmentationPrimitive& primitive)
  : seed_point(seed_point),
    points(),
    parent(NULL),
    children(),
    pairs(),
    primitive(primitive),
    area(0),
    color(0,0,0),
    timestamp(0),
    category_identifier(-1),
    category_confidence(0),
    possible_affinity(0),
    total_affinity(0),
    segmentation(NULL),
    segmentation_index(-1)
{
  // Update color and area
  if (seed_point) color = seed_point->color;
  if (seed_point) timestamp = seed_point->timestamp;
  if (seed_point) area = seed_point->area;
  if (seed_point) category_identifier = seed_point->category_identifier;
  if (seed_point) category_confidence = seed_point->category_confidence;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %rbp
movq %rsi, %r12
movq %rdi, %r15
movq %rsi, (%rdi)
leaq 0x8(%rdi), %rbx
movq %rbx, %rdi
callq 0xb1eda
andq $0x0, 0x18(%r15)
leaq 0x20(%r15), %r14
movq %r14, %rdi
callq 0xb1eda
leaq 0x30(%r15), %r13
movq %r13, %rdi
callq 0xb1eda
leaq 0x40(%r15), %rdi
movq %rbp, %rsi
callq 0x2732a
andq $0x0, 0xe8(%r15)
leaq 0xf0(%r15), %rbp
xorps %xmm0, %xmm0
xorps %xmm1, %xmm1
xorps %xmm2, %xmm2
movq %rbp, %rdi
callq 0xb1d52
andq $0x0, 0x108(%r15)
orl $-0x1, 0x110(%r15)
xorps %xmm0, %xmm0
movups %xmm0, 0x118(%r15)
movups %xmm0, 0x128(%r15)
orl $-0x1, 0x138(%r15)
testq %r12, %r12
je 0x27ff5
leaq 0x78(%r12), %rsi
movq %rbp, %rdi
callq 0xb1de2
movsd 0x68(%r12), %xmm0
movsd %xmm0, 0x108(%r15)
movsd 0x70(%r12), %xmm0
movsd %xmm0, 0xe8(%r15)
movl 0x90(%r12), %eax
movl %eax, 0x110(%r15)
movsd 0x98(%r12), %xmm0
movsd %xmm0, 0x118(%r15)
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %r12
jmp 0x28022
movq %rax, %r12
jmp 0x2802a
movq %rax, %r12
jmp 0x28032
movq %rax, %r12
addq $0x48, %r15
movq %r15, %rdi
callq 0x7cbba
movq %r13, %rdi
callq 0xb1f48
movq %r14, %rdi
callq 0xb1f48
movq %rbx, %rdi
callq 0xb1f48
movq %r12, %rdi
callq 0x15af0
// File: /workspace/github_cpp_makefile_star2_O2/tomfunkhouser[P]gaps/pkgs/R3Utils/R3Segmentation.cpp
// Function: gaps::R3SegmentationCluster::RemovePoint(gaps::R3SegmentationPoint*)
void R3SegmentationCluster::
RemovePoint(R3SegmentationPoint *point)
{
  // Just checking
  assert(point->cluster == this);
  assert(point->cluster_index >= 0);

  // Update cluster
  total_affinity -= point->cluster_affinity;
  color = (points.NEntries() > 1) ? (points.NEntries()*color - point->color) / (points.NEntries()-1) : RNblack_rgb;
  timestamp = (points.NEntries() > 1) ? (points.NEntries()*timestamp - point->timestamp) / (points.NEntries()-1) : 0;
  area -= point->area;

  // Remove point
  RNArrayEntry *entry = points.KthEntry(point->cluster_index);
  R3SegmentationPoint *tail = points.Tail();
  tail->cluster_index = point->cluster_index;
  points.EntryContents(entry) = tail;
  points.RemoveTail();

  // Update point
  point->cluster = NULL;
  point->cluster_index = -1;
  point->cluster_affinity = 0;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x48, %rsp
movq %rsi, %rbx
movq %rdi, %r14
movsd 0x128(%rdi), %xmm0
subsd 0xc8(%rsi), %xmm0
movsd %xmm0, 0x128(%rdi)
movl 0x14(%rdi), %eax
cmpl $0x2, %eax
jl 0x2847a
cvtsi2sd %eax, %xmm0
leaq 0xf0(%r14), %rsi
leaq 0x18(%rsp), %r15
movq %r15, %rdi
callq 0x26c7b
leaq 0x78(%rbx), %rdx
leaq 0x30(%rsp), %r12
movq %r12, %rdi
movq %r15, %rsi
callq 0x2c287
movl 0x14(%r14), %eax
decl %eax
cvtsi2sd %eax, %xmm0
movq %rsp, %rdi
movq %r12, %rsi
callq 0x26c4f
jmp 0x28489
leaq 0x5364ef(%rip), %rsi    # 0x55e970
movq %rsp, %rdi
callq 0xb1d34
leaq 0xf0(%r14), %rdi
movq %rsp, %rsi
callq 0xb1de2
movslq 0x14(%r14), %rax
xorpd %xmm0, %xmm0
cmpq $0x2, %rax
jl 0x284c3
cvtsi2sd %eax, %xmm0
mulsd 0x108(%r14), %xmm0
subsd 0x68(%rbx), %xmm0
leal -0x1(%rax), %ecx
cvtsi2sd %ecx, %xmm1
divsd %xmm1, %xmm0
leaq 0x8(%r14), %rdi
movsd %xmm0, 0x108(%r14)
movsd 0xe8(%r14), %xmm0
subsd 0x70(%rbx), %xmm0
movsd %xmm0, 0xe8(%r14)
movslq 0xd0(%rbx), %rcx
movq 0x8(%r14), %rdx
movq -0x8(%rdx,%rax,8), %rax
movl %ecx, 0xd0(%rax)
movq %rax, (%rdx,%rcx,8)
callq 0x1df5e
xorpd %xmm0, %xmm0
movupd %xmm0, 0xc0(%rbx)
orl $-0x1, 0xd0(%rbx)
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/tomfunkhouser[P]gaps/pkgs/R3Utils/R3Segmentation.cpp
// Function: gaps::R3SegmentationCluster::InsertPoint(gaps::R3SegmentationPoint*, double)
void R3SegmentationCluster::
InsertPoint(R3SegmentationPoint *point, RNScalar affinity)
{
  // Remove from previous cluster
  if (point->cluster ) {
    if (point->cluster == this) return;
    else point->cluster->RemovePoint(point);
  }

  // Update cluster
  total_affinity += affinity; // point->cluster_affinity;
  color = (point->color + points.NEntries()*color) / (points.NEntries()+1);
  timestamp = (point->timestamp + points.NEntries()*timestamp) / (points.NEntries()+1);
  area += point->area;

  // Update category
  if ((category_identifier < 0) && (point->category_identifier >= 0)) {
    category_identifier = point->category_identifier;
    category_confidence = point->category_confidence;
  }

  // Update point
  point->cluster = this;
  point->cluster_index = points.NEntries();
  point->cluster_affinity = affinity;

  // Insert point
  points.Insert(point);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x58, %rsp
movq %rsi, %rbx
movq %rdi, %r14
movq 0xc0(%rsi), %rdi
testq %rdi, %rdi
movsd %xmm0, (%rsp)
je 0x28909
cmpq %r14, %rdi
je 0x28a15
movq %rbx, %rsi
callq 0x28406
movsd (%rsp), %xmm0
movsd 0x128(%r14), %xmm1
addsd %xmm0, %xmm1
movsd %xmm1, 0x128(%r14)
leaq 0x78(%rbx), %r12
leaq 0x8(%r14), %rax
movq %rax, 0x8(%rsp)
cvtsi2sdl 0x14(%r14), %xmm0
leaq 0xf0(%r14), %r13
leaq 0x10(%rsp), %rbp
movq %rbp, %rdi
movq %r13, %rsi
callq 0x26c7b
leaq 0x28(%rsp), %r15
movq %r15, %rdi
movq %r12, %rsi
movq %rbp, %rdx
callq 0x2c25d
movl 0x14(%r14), %eax
incl %eax
cvtsi2sd %eax, %xmm0
leaq 0x40(%rsp), %r12
movq %r12, %rdi
movq %r15, %rsi
callq 0x26c4f
movq %r13, %rdi
movq %r12, %rsi
callq 0xb1de2
movl 0x14(%r14), %eax
cvtsi2sd %eax, %xmm0
mulsd 0x108(%r14), %xmm0
addsd 0x68(%rbx), %xmm0
leal 0x1(%rax), %ecx
cvtsi2sd %ecx, %xmm1
divsd %xmm1, %xmm0
movsd %xmm0, 0x108(%r14)
movsd 0x70(%rbx), %xmm0
addsd 0xe8(%r14), %xmm0
movsd %xmm0, 0xe8(%r14)
cmpl $0x0, 0x110(%r14)
jns 0x289ee
movl 0x90(%rbx), %ecx
testl %ecx, %ecx
js 0x289ee
movl %ecx, 0x110(%r14)
movsd 0x98(%rbx), %xmm0
movsd %xmm0, 0x118(%r14)
movq %r14, 0xc0(%rbx)
movl %eax, 0xd0(%rbx)
movsd (%rsp), %xmm0
movsd %xmm0, 0xc8(%rbx)
movq 0x8(%rsp), %rdi
movq %rbx, %rsi
callq 0x1a04c
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/tomfunkhouser[P]gaps/pkgs/R3Utils/R3Segmentation.cpp
// Function: gaps::R3SegmentationCluster::~R3SegmentationCluster()
R3SegmentationCluster::
~R3SegmentationCluster(void)
{
  // Delete children
  // for (int i = 0; i < children.NEntries(); i++) {
  //   delete children.Kth(i);
  // }

  // Remove from parent
  if (parent) parent->children.Remove(this);

  // Empty points
  EmptyPoints();
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
movq 0x18(%rdi), %rdi
testq %rdi, %rdi
je 0x28a3d
addq $0x20, %rdi
movq %rbx, %rsi
callq 0x2c5ea
movq %rbx, %rdi
callq 0x28a76
leaq 0x48(%rbx), %rdi
callq 0x7cbba
leaq 0x30(%rbx), %rdi
callq 0xb1f48
leaq 0x20(%rbx), %rdi
callq 0xb1f48
addq $0x8, %rbx
movq %rbx, %rdi
popq %rbx
jmp 0xb1f48
movq %rax, %rdi
callq 0x1dee1
nop
// File: /workspace/github_cpp_makefile_star2_O2/tomfunkhouser[P]gaps/pkgs/R3Utils/R3Segmentation.cpp
// Function: gaps::R3SegmentationCluster::EmptyPoints()
void R3SegmentationCluster::
EmptyPoints(void)
{
  // Update points
  for (int i = 0; i < points.NEntries(); i++) {
    R3SegmentationPoint *point = points.Kth(i);
    point->cluster = NULL;
    point->cluster_affinity = 0;
    point->cluster_index = -1;
  }

  // Empty points
  points.Empty();

  // Update color and area
  color = RNblack_rgb;
  timestamp = 0;
  area = 0;

  // Update affinity
  total_affinity = 0;
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
addq $0x8, %rdi
movl 0x14(%rbx), %eax
movq 0x8(%rbx), %rcx
xorl %edx, %edx
testl %eax, %eax
cmovlel %edx, %eax
xorps %xmm0, %xmm0
cmpq %rdx, %rax
je 0x28aab
movq (%rcx,%rdx,8), %rsi
movups %xmm0, 0xc0(%rsi)
orl $-0x1, 0xd0(%rsi)
incq %rdx
jmp 0x28a8f
xorl %esi, %esi
callq 0xb20f8
leaq 0xf0(%rbx), %rdi
leaq 0x535eb0(%rip), %rsi    # 0x55e970
callq 0xb1de2
andq $0x0, 0x108(%rbx)
andq $0x0, 0xe8(%rbx)
andq $0x0, 0x128(%rbx)
popq %rbx
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/tomfunkhouser[P]gaps/pkgs/R3Utils/R3Segmentation.cpp
// Function: gaps::R3SegmentationCluster::AxisExtents()
R3Box R3SegmentationCluster::
AxisExtents(void)
{
  // Get centroid and axes
  R3Point center;
  R3Triad triad = PrincipleAxes(&center);
  
  // Find extent
  R3Box extent = R3null_box;
  for (int i = 0; i < points.NEntries(); i++) {
    R3Point position = points[i]->position;
    R3Vector vector = position - center;
    RNScalar x = triad.Axis(0).Dot(vector);
    RNScalar y = triad.Axis(1).Dot(vector);
    RNScalar z = triad.Axis(2).Dot(vector);
    extent.Union(R3Point(x, y, z));
  }

  // Return extent
  return extent;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xb8, %rsp
movq %rsi, %r14
movq %rdi, %rbx
leaq 0x10(%rsp), %r15
movq %r15, %rdi
callq 0x9038e
xorl %ebp, %ebp
leaq 0x28(%rsp), %rdi
movq %r14, %rsi
movq %r15, %rdx
xorl %ecx, %ecx
callq 0x28b02
leaq 0x133f9d(%rip), %rsi    # 0x15cc88
movq %rbx, %rdi
callq 0x7bef2
leaq 0xa0(%rsp), %r15
leaq 0x88(%rsp), %r12
leaq 0x70(%rsp), %r13
movslq 0x14(%r14), %rax
cmpq %rax, %rbp
jge 0x28d90
movq 0x8(%r14), %rax
movq (%rax,%rbp,8), %rsi
addq $0x8, %rsi
movq %r15, %rdi
callq 0x903a0
movq %r12, %rdi
movq %r15, %rsi
leaq 0x10(%rsp), %rdx
callq 0x9056d
leaq 0x28(%rsp), %rdi
movq %r12, %rsi
callq 0x90dca
movsd %xmm0, 0x8(%rsp)
leaq 0x40(%rsp), %rdi
movq %r12, %rsi
callq 0x90dca
movsd %xmm0, (%rsp)
leaq 0x58(%rsp), %rdi
movq %r12, %rsi
callq 0x90dca
movaps %xmm0, %xmm2
movq %r13, %rdi
movsd 0x8(%rsp), %xmm0
movsd (%rsp), %xmm1
callq 0x90390
movq %rbx, %rdi
movq %r13, %rsi
callq 0x7c858
incq %rbp
jmp 0x28d08
movq %rbx, %rax
addq $0xb8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x28daf
jmp 0x28daf
jmp 0x28daf
jmp 0x28daf
jmp 0x28daf
movq %rax, %r14
movq %rbx, %rdi
callq 0x7cbba
movq %r14, %rdi
callq 0x15af0