LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/R3Shapes/R3PointSet.cpp
// Function: gaps::R3PointSet::ReadFile(char const*)
int R3PointSet::
ReadFile(const char *filename)
{
  // Parse input filename extension
  const char *extension;
  if (!(extension = strrchr(filename, '.'))) {
    printf("Filename %s has no extension (e.g., .mm)\n", filename);
    return 0;
  }

  // Read file of appropriate type
  if (!strcmp(extension, ".xyz")) return ReadXYZFile(filename);
  else if (!strcmp(extension, ".xyzn")) return ReadXYZNFile(filename);
  else if (!strcmp(extension, ".pset")) return ReadBinaryFile(filename);
  else if (!strcmp(extension, ".pts")) return ReadPTSFile(filename);
  else if (!strcmp(extension, ".sdf")) return ReadSDFFile(filename);
  else if (!strcmp(extension, ".vts")) return ReadVTSFile(filename);
  else return ReadMeshFile(filename);

  // Should not get here
  RNFail("Unrecognized file extension in %s\n", filename);
  return 0;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rsi, %rbx
movq %rdi, %r14
movq %rsi, %rdi
movl $0x2e, %esi
callq 0x22980
testq %rax, %rax
je 0x80ebe
movq %rax, %r15
leaq 0x765b3(%rip), %rsi     # 0xf73ea
movq %rax, %rdi
callq 0x22ce0
testl %eax, %eax
je 0x80ed7
leaq 0x765a1(%rip), %rsi     # 0xf73ef
movq %r15, %rdi
callq 0x22ce0
testl %eax, %eax
je 0x80ee7
leaq 0x76590(%rip), %rsi     # 0xf73f5
movq %r15, %rdi
callq 0x22ce0
testl %eax, %eax
je 0x80ef7
leaq 0x7657f(%rip), %rsi     # 0xf73fb
movq %r15, %rdi
callq 0x22ce0
testl %eax, %eax
je 0x80f07
leaq 0x76571(%rip), %rsi     # 0xf7400
movq %r15, %rdi
callq 0x22ce0
testl %eax, %eax
je 0x80f17
leaq 0x76563(%rip), %rsi     # 0xf7405
movq %r15, %rdi
callq 0x22ce0
movq %r14, %rdi
movq %rbx, %rsi
testl %eax, %eax
je 0x80f27
popq %rbx
popq %r14
popq %r15
jmp 0x81670
leaq 0x764fb(%rip), %rdi     # 0xf73c0
movq %rbx, %rsi
xorl %eax, %eax
callq 0x22080
xorl %eax, %eax
popq %rbx
popq %r14
popq %r15
retq
movq %r14, %rdi
movq %rbx, %rsi
popq %rbx
popq %r14
popq %r15
jmp 0x80f32
movq %r14, %rdi
movq %rbx, %rsi
popq %rbx
popq %r14
popq %r15
jmp 0x81022
movq %r14, %rdi
movq %rbx, %rsi
popq %rbx
popq %r14
popq %r15
jmp 0x81168
movq %r14, %rdi
movq %rbx, %rsi
popq %rbx
popq %r14
popq %r15
jmp 0x81360
movq %r14, %rdi
movq %rbx, %rsi
popq %rbx
popq %r14
popq %r15
jmp 0x81486
popq %rbx
popq %r14
popq %r15
jmp 0x81576
nop
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/R3Shapes/R3PointSet.cpp
// Function: gaps::R3PointSet::ReadXYZFile(char const*)
int R3PointSet::
ReadXYZFile(const char *filename)
{
  // Open file
  FILE *fp = fopen(filename, "r");
  if (!fp) {
    RNFail("Unable to open %s\n", filename);
    return 0;
  }

  // Read points
  double px, py, pz;
  while (fscanf(fp, "%lf%lf%lf", &px, &py, &pz) == (unsigned int) 3) {
    R3Point position(px,py,pz);
    InsertPoint(position);
  }

  // Close file
  fclose(fp);

  // Return success
  return 1;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movq %rsi, %r15
movq %rdi, %rbx
leaq 0x7ab56(%rip), %rsi     # 0xfbaa3
movq %r15, %rdi
callq 0x22a80
testq %rax, %rax
je 0x80ffe
movq %rax, %r14
leaq 0x759ad(%rip), %rsi     # 0xf6915
leaq 0x18(%rsp), %rdx
leaq 0x10(%rsp), %rcx
leaq 0x8(%rsp), %r8
movq %rax, %rdi
xorl %eax, %eax
callq 0x23160
cmpl $0x3, %eax
jne 0x80fef
leaq 0x20(%rsp), %r15
leaq 0x18(%rsp), %r13
leaq 0x10(%rsp), %rbp
leaq 0x8(%rsp), %r12
movsd 0x18(%rsp), %xmm0
movsd 0x10(%rsp), %xmm1
movsd 0x8(%rsp), %xmm2
movq %r15, %rdi
callq 0x7e04e
movq 0x8(%rbx), %rax
subq (%rbx), %rax
shrq $0x3, %rax
imull $0xaaaaaaab, %eax, %esi # imm = 0xAAAAAAAB
movq %rbx, %rdi
movq %r15, %rdx
callq 0x7ff52
movq %r14, %rdi
leaq 0x7593b(%rip), %rsi     # 0xf6915
movq %r13, %rdx
movq %rbp, %rcx
movq %r12, %r8
xorl %eax, %eax
callq 0x23160
cmpl $0x3, %eax
je 0x80f9a
movq %r14, %rdi
callq 0x22880
movl $0x1, %ebx
jmp 0x81011
leaq 0x76405(%rip), %rdi     # 0xf740a
xorl %ebx, %ebx
movq %r15, %rsi
xorl %eax, %eax
callq 0xa2c4e
movl %ebx, %eax
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/R3Shapes/R3PointSet.cpp
// Function: gaps::R3PointSet::ReadXYZNFile(char const*)
int R3PointSet::
ReadXYZNFile(const char *filename)
{
  // Open file
  FILE *fp = fopen(filename, "r");
  if (!fp) {
    RNFail("Unable to open %s\n", filename);
    return 0;
  }

  // Read points
  double px, py, pz, nx, ny, nz;
  while (fscanf(fp, "%lf%lf%lf%lf%lf%lf", &px, &py, &pz, &nx, &ny, &nz) == (unsigned int) 6) {
    R3Point position(px,py,pz);
    R3Vector normal(nx,ny,nz);
    normal.Normalize();
    int index = InsertPoint(position);
    SetPointNormal(index, normal);
  }

  // Close file
  fclose(fp);

  // Return success
  return 1;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x68, %rsp
movq %rsi, %r15
movq %rdi, %rbx
leaq 0x7aa66(%rip), %rsi     # 0xfbaa3
movq %r15, %rdi
callq 0x22a80
testq %rax, %rax
je 0x81144
movq %rax, %r14
leaq 0x28(%rsp), %rbp
leaq 0x30(%rsp), %r13
leaq 0x73d68(%rip), %rsi     # 0xf4dca
leaq 0x20(%rsp), %rdx
leaq 0x18(%rsp), %rcx
leaq 0x10(%rsp), %r8
leaq 0x8(%rsp), %r9
movq %rax, %rdi
xorl %eax, %eax
pushq %rbp
pushq %r13
callq 0x23160
addq $0x10, %rsp
cmpl $0x6, %eax
jne 0x81135
movsd 0x20(%rsp), %xmm0
movsd 0x18(%rsp), %xmm1
movsd 0x10(%rsp), %xmm2
leaq 0x38(%rsp), %rdi
callq 0x7e04e
movsd 0x8(%rsp), %xmm0
movsd 0x30(%rsp), %xmm1
movsd 0x28(%rsp), %xmm2
leaq 0x50(%rsp), %r12
movq %r12, %rdi
callq 0x7eae6
movq %r12, %rdi
callq 0x7ee08
movq 0x8(%rbx), %rax
subq (%rbx), %rax
shrq $0x3, %rax
movq %r14, %r15
movq %r13, %r14
movq %rbp, %r13
imull $0xaaaaaaab, %eax, %ebp # imm = 0xAAAAAAAB
movq %rbx, %rdi
movl %ebp, %esi
leaq 0x38(%rsp), %rdx
callq 0x7ff52
movq %rbx, %rdi
movl %ebp, %esi
movq %r13, %rbp
movq %r14, %r13
movq %r15, %r14
movq %r12, %rdx
callq 0x7ffd2
movq %r15, %rdi
leaq 0x73cae(%rip), %rsi     # 0xf4dca
leaq 0x20(%rsp), %rdx
leaq 0x18(%rsp), %rcx
leaq 0x10(%rsp), %r8
leaq 0x8(%rsp), %r9
jmp 0x81079
movq %r14, %rdi
callq 0x22880
movl $0x1, %ebx
jmp 0x81157
leaq 0x762bf(%rip), %rdi     # 0xf740a
xorl %ebx, %ebx
movq %r15, %rsi
xorl %eax, %eax
callq 0xa2c4e
movl %ebx, %eax
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/R3Shapes/R3PointSet.cpp
// Function: gaps::R3PointSet::ReadPTSFile(char const*)
int R3PointSet::
ReadPTSFile(const char *filename)
{
  // Open file
  FILE *fp = fopen(filename, "rb");
  if (!fp) {
    RNFail("Unable to open %s\n", filename);
    return 0;
  }

  // Read points
  float buf[6];
  while (fread(buf, sizeof(float), 6, fp) == (unsigned int) 6) {
    R3Point position(buf[0], buf[1], buf[2]);
    R3Vector normal(buf[3], buf[4], buf[5]);
    normal.Normalize();
    int index = InsertPoint(position);
    SetPointNormal(index, normal);
  }

  // Close file
  fclose(fp);

  // Return success
  return 1;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x48, %rsp
movq %rsi, %r15
movq %rdi, %rbx
leaq 0x742ef(%rip), %rsi     # 0xf566a
movq %r15, %rdi
callq 0x22a80
testq %rax, %rax
je 0x81461
movq %rax, %r14
movq %rsp, %rdi
movl $0x4, %esi
movl $0x6, %edx
movq %rax, %rcx
callq 0x22e20
cmpq $0x6, %rax
jne 0x81452
leaq 0x30(%rsp), %r15
leaq 0x18(%rsp), %r12
movq %rsp, %r13
xorps %xmm0, %xmm0
cvtss2sd (%rsp), %xmm0
xorps %xmm1, %xmm1
cvtss2sd 0x4(%rsp), %xmm1
xorps %xmm2, %xmm2
cvtss2sd 0x8(%rsp), %xmm2
movq %r15, %rdi
callq 0x7e04e
xorps %xmm0, %xmm0
cvtss2sd 0xc(%rsp), %xmm0
xorps %xmm1, %xmm1
cvtss2sd 0x10(%rsp), %xmm1
xorps %xmm2, %xmm2
cvtss2sd 0x14(%rsp), %xmm2
movq %r12, %rdi
callq 0x7eae6
movq %r12, %rdi
callq 0x7ee08
movq 0x8(%rbx), %rax
subq (%rbx), %rax
shrq $0x3, %rax
imull $0xaaaaaaab, %eax, %ebp # imm = 0xAAAAAAAB
movq %rbx, %rdi
movl %ebp, %esi
movq %r15, %rdx
callq 0x7ff52
movq %rbx, %rdi
movl %ebp, %esi
movq %r12, %rdx
callq 0x7ffd2
movl $0x4, %esi
movl $0x6, %edx
movq %r13, %rdi
movq %r14, %rcx
callq 0x22e20
cmpq $0x6, %rax
je 0x813bb
movq %r14, %rdi
callq 0x22880
movl $0x1, %ebx
jmp 0x81474
leaq 0x75fa2(%rip), %rdi     # 0xf740a
xorl %ebx, %ebx
movq %r15, %rsi
xorl %eax, %eax
callq 0xa2c4e
movl %ebx, %eax
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/R3Shapes/R3PointSet.cpp
// Function: gaps::R3PointSet::ReadSDFFile(char const*)
int R3PointSet::
ReadSDFFile(const char *filename)
{
  // Open file
  FILE *fp = fopen(filename, "rb");
  if (!fp) {
    RNFail("Unable to open %s\n", filename);
    return 0;
  }

  // Read points
  float buf[4];
  while (fread(buf, sizeof(float), 4, fp) == (unsigned int) 4) {
    R3Point position(buf[0], buf[1], buf[2]);
    int index = InsertPoint(position);
    SetPointValue(index, buf[3]);
  }

  // Close file
  fclose(fp);

  // Return success
  return 1;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x30, %rsp
movq %rsi, %r15
movq %rdi, %rbx
leaq 0x741cb(%rip), %rsi     # 0xf566a
movq %r15, %rdi
callq 0x22a80
testq %rax, %rax
je 0x81553
movq %rax, %r14
movq %rsp, %rdi
movl $0x4, %esi
movl $0x4, %edx
movq %rax, %rcx
callq 0x22e20
cmpq $0x4, %rax
jne 0x81544
leaq 0x18(%rsp), %r15
movq %rsp, %r12
xorps %xmm0, %xmm0
cvtss2sd (%rsp), %xmm0
xorps %xmm1, %xmm1
cvtss2sd 0x4(%rsp), %xmm1
xorps %xmm2, %xmm2
cvtss2sd 0x8(%rsp), %xmm2
movq %r15, %rdi
callq 0x7e04e
movq 0x8(%rbx), %rax
subq (%rbx), %rax
shrq $0x3, %rax
imull $0xaaaaaaab, %eax, %ebp # imm = 0xAAAAAAAB
movq %rbx, %rdi
movl %ebp, %esi
movq %r15, %rdx
callq 0x7ff52
xorps %xmm0, %xmm0
cvtss2sd 0xc(%rsp), %xmm0
movq %rbx, %rdi
movl %ebp, %esi
callq 0x8044c
movl $0x4, %esi
movl $0x4, %edx
movq %r12, %rdi
movq %r14, %rcx
callq 0x22e20
cmpq $0x4, %rax
je 0x814d6
movq %r14, %rdi
callq 0x22880
movl $0x1, %ebx
jmp 0x81566
leaq 0x75eb0(%rip), %rdi     # 0xf740a
xorl %ebx, %ebx
movq %r15, %rsi
xorl %eax, %eax
callq 0xa2c4e
movl %ebx, %eax
addq $0x30, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/R3Shapes/R3PointSet.cpp
// Function: gaps::R3PointSet::ReadVTSFile(char const*)
int R3PointSet::
ReadVTSFile(const char *filename)
{
  // Open file
  FILE *fp = fopen(filename, "r");
  if (!fp) {
    RNFail("Unable to open %s\n", filename);
    return 0;
  }

  // Read points
  int vertex_index;
  double px, py, pz;
  while (fscanf(fp, "%d%lf%lf%lf", &vertex_index, &px, &py, &pz) == (unsigned int) 4) {
    R3Point position(px,py,pz);
    InsertPoint(position);
  }

  // Close file
  fclose(fp);

  // Return success
  return 1;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movq %rsi, %r15
movq %rdi, %rbx
leaq 0x7a512(%rip), %rsi     # 0xfbaa3
movq %r15, %rdi
callq 0x22a80
testq %rax, %rax
je 0x8164c
movq %rax, %r14
leaq 0x75367(%rip), %rsi     # 0xf6913
leaq 0x4(%rsp), %rdx
leaq 0x18(%rsp), %rcx
leaq 0x10(%rsp), %r8
leaq 0x8(%rsp), %r9
movq %rax, %rdi
xorl %eax, %eax
callq 0x23160
cmpl $0x4, %eax
jne 0x8163d
leaq 0x20(%rsp), %r15
leaq 0x18(%rsp), %rbp
leaq 0x10(%rsp), %r12
leaq 0x8(%rsp), %r13
movsd 0x18(%rsp), %xmm0
movsd 0x10(%rsp), %xmm1
movsd 0x8(%rsp), %xmm2
movq %r15, %rdi
callq 0x7e04e
movq 0x8(%rbx), %rax
subq (%rbx), %rax
shrq $0x3, %rax
imull $0xaaaaaaab, %eax, %esi # imm = 0xAAAAAAAB
movq %rbx, %rdi
movq %r15, %rdx
callq 0x7ff52
movq %r14, %rdi
leaq 0x752f0(%rip), %rsi     # 0xf6913
leaq 0x4(%rsp), %rdx
movq %rbp, %rcx
movq %r12, %r8
movq %r13, %r9
xorl %eax, %eax
callq 0x23160
cmpl $0x4, %eax
je 0x815e3
movq %r14, %rdi
callq 0x22880
movl $0x1, %ebx
jmp 0x8165f
leaq 0x75db7(%rip), %rdi     # 0xf740a
xorl %ebx, %ebx
movq %r15, %rsi
xorl %eax, %eax
callq 0xa2c4e
movl %ebx, %eax
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/R3Shapes/R3PointSet.cpp
// Function: gaps::R3PointSet::ReadMeshFile(char const*)
int R3PointSet::
ReadMeshFile(const char *filename)
{
  // Read mesh file
  R3Mesh mesh;
  if (!mesh.ReadFile(filename)) {
    RNFail("Unable to read %s\n", filename);
    return 0;
  }

  // Create point for each vertex
  for (int i = 0; i < mesh.NVertices(); i++) {
    R3MeshVertex *vertex = mesh.Vertex(i);
    int index = InsertPoint(mesh.VertexPosition(vertex));
    SetPointNormal(index, mesh.VertexNormal(vertex));
    SetPointColor(index, mesh.VertexColor(vertex));
  }

  // Return success
  return 1;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x138, %rsp            # imm = 0x138
movq %rsi, %r15
movq %rdi, %r14
movq %rsp, %rbx
movq %rbx, %rdi
callq 0x597a4
movq %rbx, %rdi
movq %r15, %rsi
callq 0x667c2
testl %eax, %eax
je 0x8172b
movl $0x1, %ebx
cmpl $0x0, 0x14(%rsp)
jle 0x8173e
xorl %r13d, %r13d
movq %rsp, %r15
movq 0x8(%rsp), %rax
movq (%rax,%r13,8), %r12
leaq 0x18(%r12), %rdx
movq 0x8(%r14), %rax
subq (%r14), %rax
shrq $0x3, %rax
imull $0xaaaaaaab, %eax, %ebp # imm = 0xAAAAAAAB
movq %r14, %rdi
movl %ebp, %esi
callq 0x7ff52
testb $0x2, 0x78(%r12)
jne 0x816fc
movq (%rsp), %rax
movq %r15, %rdi
movq %r12, %rsi
callq *0x2b0(%rax)
leaq 0x30(%r12), %rdx
movq %r14, %rdi
movl %ebp, %esi
callq 0x7ffd2
addq $0x58, %r12
movq %r14, %rdi
movl %ebp, %esi
movq %r12, %rdx
callq 0x8014e
incq %r13
movslq 0x14(%rsp), %rax
cmpq %rax, %r13
jl 0x816bb
jmp 0x8173e
xorl %ebx, %ebx
leaq 0x73f57(%rip), %rdi     # 0xf568b
movq %r15, %rsi
xorl %eax, %eax
callq 0xa2c4e
movq %rsp, %rdi
callq 0x59cd2
movl %ebx, %eax
addq $0x138, %rsp            # imm = 0x138
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x8175c
movq %rax, %rbx
movq %rsp, %rdi
callq 0x59cd2
movq %rbx, %rdi
callq 0x230a0
nop
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/R3Shapes/R3PointSet.cpp
// Function: gaps::R3PointSet::WriteFile(char const*) const
int R3PointSet::
WriteFile(const char *filename) const
{
  // Parse input filename extension
  const char *extension;
  if (!(extension = strrchr(filename, '.'))) {
    printf("Filename %s has no extension (e.g., .mm)\n", filename);
    return 0;
  }

  // Write file of appropriate type
  if (!strcmp(extension, ".xyz")) return WriteXYZFile(filename);
  else if (!strcmp(extension, ".xyzn")) return WriteXYZNFile(filename);
  else if (!strcmp(extension, ".pset")) return WriteBinaryFile(filename);
  else if (!strcmp(extension, ".pts")) return WritePTSFile(filename);
  else if (!strcmp(extension, ".sdf")) return WriteSDFFile(filename);
  else return WriteMeshFile(filename);

  // Should not get here
  RNFail("Unrecognized file extension in %s\n", filename);
  return 0;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rsi, %rbx
movq %rdi, %r14
movq %rsi, %rdi
movl $0x2e, %esi
callq 0x22980
testq %rax, %rax
je 0x817ff
movq %rax, %r15
leaq 0x75c53(%rip), %rsi     # 0xf73ea
movq %rax, %rdi
callq 0x22ce0
testl %eax, %eax
je 0x81818
leaq 0x75c45(%rip), %rsi     # 0xf73ef
movq %r15, %rdi
callq 0x22ce0
testl %eax, %eax
je 0x81828
leaq 0x75c38(%rip), %rsi     # 0xf73f5
movq %r15, %rdi
callq 0x22ce0
testl %eax, %eax
je 0x81838
leaq 0x75c2b(%rip), %rsi     # 0xf73fb
movq %r15, %rdi
callq 0x22ce0
testl %eax, %eax
je 0x81848
leaq 0x75c1d(%rip), %rsi     # 0xf7400
movq %r15, %rdi
callq 0x22ce0
movq %r14, %rdi
movq %rbx, %rsi
testl %eax, %eax
je 0x81858
popq %rbx
popq %r14
popq %r15
jmp 0x81ef0
leaq 0x75bba(%rip), %rdi     # 0xf73c0
movq %rbx, %rsi
xorl %eax, %eax
callq 0x22080
xorl %eax, %eax
popq %rbx
popq %r14
popq %r15
retq
movq %r14, %rdi
movq %rbx, %rsi
popq %rbx
popq %r14
popq %r15
jmp 0x81862
movq %r14, %rdi
movq %rbx, %rsi
popq %rbx
popq %r14
popq %r15
jmp 0x81922
movq %r14, %rdi
movq %rbx, %rsi
popq %rbx
popq %r14
popq %r15
jmp 0x81a28
movq %r14, %rdi
movq %rbx, %rsi
popq %rbx
popq %r14
popq %r15
jmp 0x81c84
popq %rbx
popq %r14
popq %r15
jmp 0x81dbc
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/R3Shapes/R3PointSet.cpp
// Function: gaps::R3PointSet::WriteXYZFile(char const*) const
int R3PointSet::
WriteXYZFile(const char *filename) const
{
 // Open file
  FILE *fp = fopen(filename, "w");
  if (!fp) {
    RNFail("Unable to open %s\n", filename);
    return 0;
  }

  // Write points
  for (int i = 0; i < NPoints(); i++) {
    const R3Point& p = PointPosition(i);
    fprintf(fp, "%g %g %g\n", p[0], p[1], p[2]);
  }

  // Close file
  fclose(fp);

  // Return success
  return 1;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %rsi, %r15
movq %rdi, %rbx
leaq 0x76472(%rip), %rsi     # 0xf7cea
movq %r15, %rdi
callq 0x22a80
testq %rax, %rax
je 0x81903
movq %rax, %r14
movq (%rbx), %rax
movq 0x8(%rbx), %rcx
subq %rax, %rcx
shrq $0x3, %rcx
imull $0xaaaaaaab, %ecx, %ecx # imm = 0xAAAAAAAB
testl %ecx, %ecx
jle 0x818f4
movl $0x10, %r12d
xorl %r13d, %r13d
leaq 0x7445f(%rip), %r15     # 0xf5d0f
movsd -0x10(%rax,%r12), %xmm0
movsd -0x8(%rax,%r12), %xmm1
movsd (%rax,%r12), %xmm2
movq %r14, %rdi
movq %r15, %rsi
movb $0x3, %al
callq 0x22d60
incq %r13
movq (%rbx), %rax
movq 0x8(%rbx), %rcx
subq %rax, %rcx
shrq $0x3, %rcx
imull $0xaaaaaaab, %ecx, %ecx # imm = 0xAAAAAAAB
movslq %ecx, %rcx
addq $0x18, %r12
cmpq %rcx, %r13
jl 0x818b0
movq %r14, %rdi
callq 0x22880
movl $0x1, %ebx
jmp 0x81916
leaq 0x75b00(%rip), %rdi     # 0xf740a
xorl %ebx, %ebx
movq %r15, %rsi
xorl %eax, %eax
callq 0xa2c4e
movl %ebx, %eax
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/R3Shapes/R3PointSet.cpp
// Function: gaps::R3PointSet::WriteXYZNFile(char const*) const
int R3PointSet::
WriteXYZNFile(const char *filename) const
{
 // Open file
  FILE *fp = fopen(filename, "w");
  if (!fp) {
    RNFail("Unable to open %s\n", filename);
    return 0;
  }

  // Write points
  for (int i = 0; i < NPoints(); i++) {
    const R3Point& p = PointPosition(i);
    const R3Vector& n = PointNormal(i);
    fprintf(fp, "%g %g %g %g %g %g\n", p[0], p[1], p[2], n[0], n[1], n[2]);
  }

  // Close file
  fclose(fp);

  // Return success
  return 1;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %r15
movq %rdi, %rbx
leaq 0x763b0(%rip), %rsi     # 0xf7cea
movq %r15, %rdi
callq 0x22a80
testq %rax, %rax
je 0x81a03
movq %rax, %r14
movq (%rbx), %rax
movq 0x8(%rbx), %rcx
subq %rax, %rcx
shrq $0x3, %rcx
imull $0xaaaaaaab, %ecx, %ecx # imm = 0xAAAAAAAB
testl %ecx, %ecx
jle 0x819f4
xorl %r12d, %r12d
leaq 0x7594c(%rip), %r13     # 0xf72c0
leaq 0x75aa2(%rip), %r15     # 0xf741d
xorl %ebp, %ebp
movq 0x18(%rbx), %rcx
movq 0x20(%rbx), %rdx
subq %rcx, %rdx
shrq $0x3, %rdx
imull $0xaaaaaaab, %edx, %edx # imm = 0xAAAAAAAB
movslq %edx, %rdx
cmpq %rdx, %rbp
jl 0x8199f
movq %r13, %rcx
jmp 0x819a2
addq %r12, %rcx
movsd (%rax,%r12), %xmm0
movsd 0x8(%rax,%r12), %xmm1
movsd 0x10(%rax,%r12), %xmm2
movsd (%rcx), %xmm3
movsd 0x8(%rcx), %xmm4
movsd 0x10(%rcx), %xmm5
movq %r14, %rdi
movq %r15, %rsi
movb $0x6, %al
callq 0x22d60
incq %rbp
movq (%rbx), %rax
movq 0x8(%rbx), %rcx
subq %rax, %rcx
shrq $0x3, %rcx
imull $0xaaaaaaab, %ecx, %ecx # imm = 0xAAAAAAAB
movslq %ecx, %rcx
addq $0x18, %r12
cmpq %rcx, %rbp
jl 0x8197d
movq %r14, %rdi
callq 0x22880
movl $0x1, %ebx
jmp 0x81a16
leaq 0x75a00(%rip), %rdi     # 0xf740a
xorl %ebx, %ebx
movq %r15, %rsi
xorl %eax, %eax
callq 0xa2c4e
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/R3Shapes/R3PointSet.cpp
// Function: gaps::R3PointSet::WritePTSFile(char const*) const
int R3PointSet::
WritePTSFile(const char *filename) const
{
 // Open file
  FILE *fp = fopen(filename, "wb");
  if (!fp) {
    RNFail("Unable to open %s\n", filename);
    return 0;
  }

  // Write points
  float buf[6];
  for (int i = 0; i < NPoints(); i++) {
    const R3Point& p = PointPosition(i);
    const R3Vector& n = PointNormal(i);
    buf[0] = p[0]; buf[1] = p[1]; buf[2] = p[2];
    buf[3] = n[0]; buf[4] = n[1]; buf[5] = n[2];
    if (fwrite(buf, sizeof(float), 6, fp) != (unsigned int) 6) {
      RNFail("Unable to write point %d to %s\n", i, filename);
      return 0;
    }
  }

  // Close file
  fclose(fp);

  // Return success
  return 1;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rsi, %rbx
movq %rdi, %r14
leaq 0x75001(%rip), %rsi     # 0xf6ca0
movq %rbx, %rdi
callq 0x22a80
testq %rax, %rax
je 0x81d80
movq %rax, %r15
movq (%r14), %rax
movq 0x8(%r14), %rcx
subq %rax, %rcx
shrq $0x3, %rcx
imull $0xaaaaaaab, %ecx, %ecx # imm = 0xAAAAAAAB
testl %ecx, %ecx
jle 0x81d71
xorl %ebp, %ebp
movq %rsp, %r13
xorl %r12d, %r12d
movq 0x18(%r14), %rcx
movq 0x20(%r14), %rdx
subq %rcx, %rdx
shrq $0x3, %rdx
imull $0xaaaaaaab, %edx, %edx # imm = 0xAAAAAAAB
movslq %edx, %rdx
cmpq %rdx, %r12
jl 0x81cfd
leaq 0x755c5(%rip), %rcx     # 0xf72c0
jmp 0x81d00
addq %rbp, %rcx
movupd (%rax,%rbp), %xmm0
movsd 0x10(%rax,%rbp), %xmm1
movhpd (%rcx), %xmm1           # xmm1 = xmm1[0],mem[0]
cvtpd2ps %xmm1, %xmm1
cvtpd2ps %xmm0, %xmm0
unpcklpd %xmm1, %xmm0            # xmm0 = xmm0[0],xmm1[0]
movapd %xmm0, (%rsp)
movupd 0x8(%rcx), %xmm0
cvtpd2ps %xmm0, %xmm0
movlpd %xmm0, 0x10(%rsp)
movl $0x4, %esi
movl $0x6, %edx
movq %r13, %rdi
movq %r15, %rcx
callq 0x23250
cmpq $0x6, %rax
jne 0x81d95
incq %r12
movq (%r14), %rax
movq 0x8(%r14), %rcx
subq %rax, %rcx
shrq $0x3, %rcx
imull $0xaaaaaaab, %ecx, %ecx # imm = 0xAAAAAAAB
movslq %ecx, %rcx
addq $0x18, %rbp
cmpq %rcx, %r12
jl 0x81cd7
movq %r15, %rdi
callq 0x22880
movl $0x1, %ebp
jmp 0x81dab
leaq 0x75683(%rip), %rdi     # 0xf740a
xorl %ebp, %ebp
movq %rbx, %rsi
xorl %eax, %eax
callq 0xa2c4e
jmp 0x81dab
leaq 0x75694(%rip), %rdi     # 0xf7430
xorl %ebp, %ebp
movl %r12d, %esi
movq %rbx, %rdx
xorl %eax, %eax
callq 0xa2c4e
movl %ebp, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/R3Shapes/R3PointSet.cpp
// Function: gaps::R3PointSet::WriteSDFFile(char const*) const
int R3PointSet::
WriteSDFFile(const char *filename) const
{
 // Open file
  FILE *fp = fopen(filename, "wb");
  if (!fp) {
    RNFail("Unable to open %s\n", filename);
    return 0;
  }

  // Write points
  float buf[4];
  for (int i = 0; i < NPoints(); i++) {
    const R3Point& p = PointPosition(i);
    buf[0] = p[0]; buf[1] = p[1]; buf[2] = p[2];
    buf[3] = PointValue(i);
    if (fwrite(buf, sizeof(float), 4, fp) != (unsigned int) 4) {
      RNFail("Unable to write point %d to %s\n", i, filename);
      return 0;
    }
  }

  // Close file
  fclose(fp);

  // Return success
  return 1;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rsi, %rbx
movq %rdi, %r14
leaq 0x74ec9(%rip), %rsi     # 0xf6ca0
movq %rbx, %rdi
callq 0x22a80
testq %rax, %rax
je 0x81eb4
movq %rax, %r15
movq (%r14), %rax
movq 0x8(%r14), %rcx
subq %rax, %rcx
shrq $0x3, %rcx
imull $0xaaaaaaab, %ecx, %ecx # imm = 0xAAAAAAAB
testl %ecx, %ecx
jle 0x81ea5
movl $0x2, %ebp
xorl %r12d, %r12d
movq %rsp, %r13
movupd -0x10(%rax,%rbp,8), %xmm0
cvtpd2ps %xmm0, %xmm0
movlpd %xmm0, (%rsp)
xorps %xmm0, %xmm0
cvtsd2ss (%rax,%rbp,8), %xmm0
movss %xmm0, 0x8(%rsp)
movq 0xf0(%r14), %rax
movq 0xf8(%r14), %rcx
subq %rax, %rcx
shrq $0x3, %rcx
movslq %ecx, %rcx
movss 0x744d1(%rip), %xmm0    # 0xf6320
cmpq %rcx, %r12
jge 0x81e5d
xorps %xmm0, %xmm0
cvtsd2ss (%rax,%r12,8), %xmm0
movss %xmm0, 0xc(%rsp)
movl $0x4, %esi
movl $0x4, %edx
movq %r13, %rdi
movq %r15, %rcx
callq 0x23250
cmpq $0x4, %rax
jne 0x81ec9
incq %r12
movq (%r14), %rax
movq 0x8(%r14), %rcx
subq %rax, %rcx
shrq $0x3, %rcx
imull $0xaaaaaaab, %ecx, %ecx # imm = 0xAAAAAAAB
movslq %ecx, %rcx
addq $0x3, %rbp
cmpq %rcx, %r12
jl 0x81e12
movq %r15, %rdi
callq 0x22880
movl $0x1, %ebp
jmp 0x81edf
leaq 0x7554f(%rip), %rdi     # 0xf740a
xorl %ebp, %ebp
movq %rbx, %rsi
xorl %eax, %eax
callq 0xa2c4e
jmp 0x81edf
leaq 0x75560(%rip), %rdi     # 0xf7430
xorl %ebp, %ebp
movl %r12d, %esi
movq %rbx, %rdx
xorl %eax, %eax
callq 0xa2c4e
movl %ebp, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/R3Shapes/R3PointSet.cpp
// Function: gaps::R3PointSet::WriteMeshFile(char const*) const
int R3PointSet::
WriteMeshFile(const char *filename) const
{
  // Create mesh
  R3Mesh mesh;
  for (int i = 0; i < NPoints(); i++) {
    mesh.CreateVertex(PointPosition(i), PointNormal(i), PointColor(i));
  }

  // Write mesh
  return mesh.WriteFile(filename);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x148, %rsp            # imm = 0x148
movq %rsi, 0x8(%rsp)
movq %rdi, %r14
leaq 0x10(%rsp), %rdi
callq 0x597a4
movq (%r14), %rsi
movq 0x8(%r14), %rax
subq %rsi, %rax
shrq $0x3, %rax
imull $0xaaaaaaab, %eax, %eax # imm = 0xAAAAAAAB
testl %eax, %eax
jle 0x81fc2
xorl %r12d, %r12d
leaq 0x75387(%rip), %r13     # 0xf72c0
leaq 0xeb740(%rip), %rbp     # 0x16d680
leaq 0x10(%rsp), %r15
xorl %ebx, %ebx
movq 0x18(%r14), %rdx
movq 0x20(%r14), %rax
subq %rdx, %rax
shrq $0x3, %rax
imull $0xaaaaaaab, %eax, %eax # imm = 0xAAAAAAAB
cltq
cmpq %rax, %rbx
jl 0x81f68
movq %r13, %rdx
jmp 0x81f6b
addq %r12, %rdx
movq 0x80(%r14), %rax
movq 0x78(%r14), %rcx
subq %rcx, %rax
shrq $0x3, %rax
imull $0xaaaaaaab, %eax, %eax # imm = 0xAAAAAAAB
cltq
cmpq %rax, %rbx
jl 0x81f8f
movq %rbp, %rcx
jmp 0x81f92
addq %r12, %rcx
addq %r12, %rsi
movq %r15, %rdi
xorl %r8d, %r8d
callq 0x5ccc0
incq %rbx
movq (%r14), %rsi
movq 0x8(%r14), %rax
subq %rsi, %rax
shrq $0x3, %rax
imull $0xaaaaaaab, %eax, %eax # imm = 0xAAAAAAAB
cltq
addq $0x18, %r12
cmpq %rax, %rbx
jl 0x81f47
leaq 0x10(%rsp), %rdi
movq 0x8(%rsp), %rsi
callq 0x6a902
movl %eax, %ebx
leaq 0x10(%rsp), %rdi
callq 0x59cd2
movl %ebx, %eax
addq $0x148, %rsp            # imm = 0x148
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x81ff3
movq %rax, %rbx
leaq 0x10(%rsp), %rdi
callq 0x59cd2
movq %rbx, %rdi
callq 0x230a0
// File: /workspace/github_cpp_makefile_star2_O1/kusumi[P]procstat/container.cc
// Function: Container::Container(int, char**)
Container::Container(int argc, char *argv[])
{
	_build_window();
	for (int i = 0; i < argc; i++) {
		char *p = argv[i];
		struct stat st;
		if (stat(p, &st) == -1 || !S_ISREG(st.st_mode))
			continue;
		if (i < static_cast<int>(_v.size())) {
			_v[i]->attach_buffer(p);
			int wd = add_watch(p);
			if (wd != -1)
				_map.insert(_map_t::value_type(wd, _v[i]));
		}
	}
	_it = _v.begin();
	(*_it)->focus(true);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xc8, %rsp
movq %rdx, %r14
movl %esi, %ebp
xorps %xmm0, %xmm0
movups %xmm0, 0x10(%rdi)
movups %xmm0, (%rdi)
leaq 0x7cf3(%rip), %rax      # 0xc3f2
cmpb $0x0, (%rax)
movq %rdi, (%rsp)
je 0x470f
callq 0x4ad2
jmp 0x4714
callq 0x49be
testl %ebp, %ebp
jle 0x47ea
movl %ebp, %r12d
xorl %r15d, %r15d
leaq 0x18(%rsp), %rbx
movq (%r14,%r15,8), %rbp
movq %rbp, %rdi
leaq 0x38(%rsp), %rsi
callq 0x3330
cmpl $-0x1, %eax
je 0x47de
movl 0x50(%rsp), %eax
movl $0xf000, %ecx           # imm = 0xF000
andl %ecx, %eax
cmpl $0x8000, %eax           # imm = 0x8000
jne 0x47de
movq (%rsp), %rcx
movq (%rcx), %rax
movq 0x8(%rcx), %rcx
subq %rax, %rcx
shrq $0x3, %rcx
movslq %ecx, %rcx
cmpq %rcx, %r15
jge 0x47de
movq (%rax,%r15,8), %r13
movq %rbx, %rdi
movq %rbp, %rsi
leaq 0x8(%rsp), %rdx
callq 0x5038
movq %r13, %rdi
movq %rbx, %rsi
callq 0x57ee
movq 0x18(%rsp), %rdi
leaq 0x28(%rsp), %rax
cmpq %rax, %rdi
je 0x47ac
movq 0x28(%rsp), %rsi
incq %rsi
callq 0x3380
movq %rbp, %rdi
callq 0x704e
cmpl $-0x1, %eax
je 0x47de
movq (%rsp), %rcx
movq (%rcx), %rcx
movl %eax, 0x8(%rsp)
movq (%rcx,%r15,8), %rax
movq %rax, 0x10(%rsp)
leaq 0x7cac(%rip), %rdi      # 0xc480
leaq 0x8(%rsp), %rsi
callq 0x5438
incq %r15
cmpq %r15, %r12
jne 0x4727
movq (%rsp), %rcx
movq (%rcx), %rax
movq %rax, 0x18(%rcx)
movq (%rax), %rdi
movl $0x1, %esi
callq 0x597c
addq $0xc8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x483b
jmp 0x483b
jmp 0x483b
movq %rax, %r14
movq 0x18(%rsp), %rdi
leaq 0x28(%rsp), %rax
cmpq %rax, %rdi
je 0x483e
movq 0x28(%rsp), %rsi
incq %rsi
callq 0x3380
jmp 0x483e
movq %rax, %r14
movq (%rsp), %rax
movq (%rax), %rdi
testq %rdi, %rdi
je 0x485a
movq (%rsp), %rax
movq 0x10(%rax), %rsi
subq %rdi, %rsi
callq 0x3380
movq %r14, %rdi
callq 0x3680
// File: /workspace/github_cpp_makefile_star2_O1/kusumi[P]procstat/main.cc
// Function: (anonymous namespace)::atexit_handler()
void atexit_handler(void)
{
	cleanup_screen();
	cleanup_watch();
	cleanup_log();
	cleanup_lock();
	if (_what)
		std::cerr << _what << std::endl;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
callq 0x6c54
callq 0x7043
callq 0x696e
movq 0x7eff(%rip), %rbx      # 0xc420
testq %rbx, %rbx
je 0x4571
movq %rbx, %rdi
callq 0x3180
movq 0x7ab3(%rip), %r14      # 0xbfe8
movq %r14, %rdi
movq %rbx, %rsi
movq %rax, %rdx
callq 0x3400
movq (%r14), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x3350
movsbl %al, %esi
movq %r14, %rdi
callq 0x3040
movq %rax, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x3260
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_cpp_makefile_star2_O1/kusumi[P]procstat/container.cc
// Function: Container::~Container()
Container::~Container(void)
{
	for (_map_t::iterator it = _map.begin(); it != _map.end(); it++)
		delete_watch(it->first);
	while (!_v.empty()) {
		Window *p = _v.back();
		_v.pop_back();
		delete p;
	}
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdi, %rbx
movq 0x7c11(%rip), %r14      # 0xc498
leaq 0x7bfa(%rip), %r15      # 0xc488
cmpq %r15, %r14
je 0x48d4
movl 0x20(%r14), %edi
callq 0x708e
movq %r14, %rdi
callq 0x3270
movq %rax, %r14
cmpq %r15, %rax
jne 0x4893
jmp 0x48d4
movq -0x8(%rax), %r14
addq $-0x8, %rax
movq %rax, 0x8(%rbx)
testq %r14, %r14
je 0x48d4
movq %r14, %rdi
callq 0x5716
movl $0x80, %esi
movq %r14, %rdi
callq 0x3380
movq (%rbx), %rdi
movq 0x8(%rbx), %rax
cmpq %rax, %rdi
jne 0x48ae
testq %rdi, %rdi
je 0x48f6
movq 0x10(%rbx), %rsi
subq %rdi, %rsi
popq %rbx
popq %r14
popq %r15
jmp 0x3380
popq %rbx
popq %r14
popq %r15
retq
movq %rax, %rdi
callq 0x5075
// File: /workspace/github_cpp_makefile_star2_O1/kusumi[P]procstat/container.cc
// Function: Container::_goto_next_window()
void Container::_goto_next_window(void)
{
	std::vector<Window*>::iterator it = _it;
	(*_it)->focus(false);
	do {
		_it++;
		if (_it == _v.end())
			_it = _v.begin();
	} while ((*_it)->is_dead() && _it != it);
	(*_it)->focus(true);
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq 0x18(%rdi), %r14
movq (%r14), %rdi
xorl %esi, %esi
callq 0x597c
movq 0x18(%rbx), %rax
addq $0x8, %rax
movq %rax, 0x18(%rbx)
cmpq 0x8(%rbx), %rax
jne 0x4932
movq (%rbx), %rax
movq %rax, 0x18(%rbx)
movq 0x18(%rbx), %rax
movq (%rax), %rdi
callq 0x5772
testb %al, %al
je 0x4948
cmpq %r14, 0x18(%rbx)
jne 0x4919
movq 0x18(%rbx), %rax
movq (%rax), %rdi
movl $0x1, %esi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x597c
// File: /workspace/github_cpp_makefile_star2_O1/kusumi[P]procstat/container.cc
// Function: Container::_goto_prev_window()
void Container::_goto_prev_window(void)
{
	std::vector<Window*>::iterator it = _it;
	(*_it)->focus(false);
	do {
		if (_it == _v.begin())
			_it = _v.end();
		_it--;
	} while ((*_it)->is_dead() && _it != it);
	(*_it)->focus(true);
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq 0x18(%rdi), %r14
movq (%r14), %rdi
xorl %esi, %esi
callq 0x597c
movq 0x18(%rbx), %rax
cmpq (%rbx), %rax
jne 0x4986
movq 0x8(%rbx), %rax
movq %rax, 0x18(%rbx)
movq 0x18(%rbx), %rax
leaq -0x8(%rax), %rcx
movq %rcx, 0x18(%rbx)
movq -0x8(%rax), %rdi
callq 0x5772
testb %al, %al
je 0x49a5
cmpq %r14, 0x18(%rbx)
jne 0x4975
movq 0x18(%rbx), %rax
movq (%rax), %rdi
movl $0x1, %esi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x597c
nop
// File: /workspace/github_cpp_makefile_star2_O1/kusumi[P]procstat/container.cc
// Function: Container::_build_window_xy()
void Container::_build_window_xy(void)
{
	int seq = 0;
	int xx = get_terminal_cols();
	int yy = get_terminal_lines();
	int x = static_cast<int>(layout.size());
	int xq = xx / x;
	int xr = xx % x;

	for (int i = 0; i < x; i++) {
		int xpos = xq * i;
		int xlen = xq;
		if (i == x - 1)
			xlen += xr;
		int y = layout[i];
		if (y == -1)
			y = 1; // ignore invalid
		int yq = yy / y;
		int yr = yy % y;

		for (int j = 0; j < y; j++) {
			int ypos = yq * j;
			int ylen = yq;
			if (j == y - 1)
				ylen += yr;
			_alloc_window(seq++, ylen, xlen, ypos, xpos);
		}
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movq %rdi, 0x18(%rsp)
callq 0x6cad
movl %eax, %ebp
callq 0x6c81
leaq 0x79e4(%rip), %rcx      # 0xc3c8
movq 0x8(%rcx), %rsi
subq (%rcx), %rsi
movl %eax, 0x10(%rsp)
shrq $0x2, %rsi
movl %ebp, %eax
cltd
idivl %esi
movl %edx, 0xc(%rsp)
movl %eax, 0x8(%rsp)
testl %esi, %esi
jle 0x4ac3
movq %rsi, %rax
leal -0x1(%rsi), %ecx
movq %rcx, 0x20(%rsp)
andl $0x7fffffff, %eax       # imm = 0x7FFFFFFF
movq %rax, 0x28(%rsp)
xorl %ecx, %ecx
xorl %esi, %esi
movq 0x18(%rsp), %r12
cmpq 0x20(%rsp), %rcx
movl $0x0, %eax
cmovel 0xc(%rsp), %eax
movl %eax, 0x4(%rsp)
leaq 0x7988(%rip), %rax      # 0xc3c8
movq (%rax), %rax
movl (%rax,%rcx,4), %ebx
cmpl $-0x1, %ebx
movl $0x1, %eax
cmovel %eax, %ebx
movl 0x10(%rsp), %eax
cltd
idivl %ebx
testl %ebx, %ebx
movq %rcx, 0x30(%rsp)
jle 0x4aaa
movl %edx, %r14d
movl %eax, %ebp
movl 0x8(%rsp), %eax
addl %eax, 0x4(%rsp)
imull %eax, %ecx
movl %ecx, 0x14(%rsp)
xorl %r15d, %r15d
cmpl $0x1, %ebx
movl $0x0, %edx
cmovel %r14d, %edx
addl %ebp, %edx
leal 0x1(%rsi), %r13d
movq %r12, %rdi
movl 0x4(%rsp), %ecx
movl %r15d, %r8d
movl 0x14(%rsp), %r9d
callq 0x4be6
addl %ebp, %r15d
movl %r13d, %esi
decl %ebx
jne 0x4a78
jmp 0x4aad
movl %esi, %r13d
movq 0x30(%rsp), %rcx
incq %rcx
movl %r13d, %esi
cmpq 0x28(%rsp), %rcx
jne 0x4a26
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/kusumi[P]procstat/container.cc
// Function: Container::_build_window_yx()
void Container::_build_window_yx(void)
{
	int seq = 0;
	int yy = get_terminal_lines();
	int xx = get_terminal_cols();
	int y = static_cast<int>(layout.size());
	int yq = yy / y;
	int yr = yy % y;

	for (int i = 0; i < y; i++) {
		int ypos = yq * i;
		int ylen = yq;
		if (i == y - 1)
			ylen += yr;
		int x = layout[i];
		if (x == -1)
			x = 1; // ignore invalid
		int xq = xx / x;
		int xr = xx % x;

		for (int j = 0; j < x; j++) {
			int xpos = xq * j;
			int xlen = xq;
			if (j == x - 1)
				xlen += xr;
			_alloc_window(seq++, ylen, xlen, ypos, xpos);
		}
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movq %rdi, 0x18(%rsp)
callq 0x6c81
movl %eax, %ebp
callq 0x6cad
leaq 0x78d0(%rip), %rcx      # 0xc3c8
movq 0x8(%rcx), %rsi
subq (%rcx), %rsi
movl %eax, 0x10(%rsp)
shrq $0x2, %rsi
movl %ebp, %eax
cltd
idivl %esi
movl %edx, 0xc(%rsp)
movl %eax, 0x8(%rsp)
testl %esi, %esi
jle 0x4bd7
movq %rsi, %rax
leal -0x1(%rsi), %ecx
movq %rcx, 0x20(%rsp)
andl $0x7fffffff, %eax       # imm = 0x7FFFFFFF
movq %rax, 0x28(%rsp)
xorl %ecx, %ecx
xorl %esi, %esi
movq 0x18(%rsp), %r12
cmpq 0x20(%rsp), %rcx
movl $0x0, %eax
cmovel 0xc(%rsp), %eax
movl %eax, 0x4(%rsp)
leaq 0x7874(%rip), %rax      # 0xc3c8
movq (%rax), %rax
movl (%rax,%rcx,4), %ebx
cmpl $-0x1, %ebx
movl $0x1, %eax
cmovel %eax, %ebx
movl 0x10(%rsp), %eax
cltd
idivl %ebx
testl %ebx, %ebx
movq %rcx, 0x30(%rsp)
jle 0x4bbe
movl %edx, %r14d
movl %eax, %ebp
movl 0x8(%rsp), %eax
addl %eax, 0x4(%rsp)
imull %eax, %ecx
movl %ecx, 0x14(%rsp)
xorl %r15d, %r15d
cmpl $0x1, %ebx
movl $0x0, %ecx
cmovel %r14d, %ecx
addl %ebp, %ecx
leal 0x1(%rsi), %r13d
movq %r12, %rdi
movl 0x4(%rsp), %edx
movl 0x14(%rsp), %r8d
movl %r15d, %r9d
callq 0x4be6
addl %ebp, %r15d
movl %r13d, %esi
decl %ebx
jne 0x4b8c
jmp 0x4bc1
movl %esi, %r13d
movq 0x30(%rsp), %rcx
incq %rcx
movl %r13d, %esi
cmpq 0x28(%rsp), %rcx
jne 0x4b3a
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/kusumi[P]procstat/container.cc
// Function: Container::_alloc_window(int, int, int, int, int)
void Container::_alloc_window(int seq, int ylen, int xlen, int ypos, int xpos)
{
	try {
		Window *p = _v.at(seq);
		p->resize(ylen, xlen, ypos, xpos);
		p->signal();
	} catch (const std::out_of_range &e) {
		Window *p = new Window(ylen, xlen, ypos, xpos);
		_v.push_back(p);
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movl %r9d, %ebp
movl %r8d, %r14d
movl %ecx, %r15d
movl %edx, %r12d
movq %rdi, %rbx
movslq %esi, %rsi
movq (%rdi), %rax
movq 0x8(%rdi), %rdx
subq %rax, %rdx
sarq $0x3, %rdx
cmpq %rsi, %rdx
jbe 0x4c48
movq (%rax,%rsi,8), %r13
movq %r13, %rdi
movl %r12d, %esi
movl %r15d, %edx
movl %r14d, %ecx
movl %ebp, %r8d
callq 0x5782
movq %r13, %rdi
callq 0x5c1c
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x3954(%rip), %rdi      # 0x85a3
xorl %eax, %eax
callq 0x3570
movq %rax, 0x8(%rsp)
cmpl $0x1, %edx
jne 0x4cc0
movq 0x8(%rsp), %rdi
callq 0x3160
movl $0x80, %edi
callq 0x3360
movq %rax, %r13
movq %rax, %rdi
movl %r12d, %esi
movl %r15d, %edx
movl %r14d, %ecx
movl %ebp, %r8d
callq 0x5620
leaq 0x10(%rsp), %rsi
movq %r13, (%rsi)
movq %rbx, %rdi
callq 0x5080
callq 0x3600
jmp 0x4c39
movq %rax, 0x8(%rsp)
movl $0x80, %esi
movq %r13, %rdi
callq 0x3380
jmp 0x4cbb
movq %rax, 0x8(%rsp)
callq 0x3600
movq 0x8(%rsp), %rdi
callq 0x3680
movq %rax, %rdi
callq 0x5075
// File: /workspace/github_cpp_makefile_star2_O1/kusumi[P]procstat/container.cc
// Function: Container::parse_event(int)
void Container::parse_event(int x)
{
	Window *p = *_it;
	switch (x) {
	case KBD_ERR:
		break;
	case KBD_RESIZE:
	case KBD_CTRL('l'):
		clear_terminal();
		_build_window();
		break;
	case 'h':
	case KBD_LEFT:
		_goto_prev_window();
		break;
	case 'l':
	case KBD_RIGHT:
		_goto_next_window();
		break;
	case '0':
		p->goto_head();
		goto _signal;
	case '$':
		p->goto_tail();
		goto _signal;
	case 'k':
	case KBD_UP:
		p->goto_current(-1);
		goto _signal;
	case 'j':
	case KBD_DOWN:
		p->goto_current(1);
		goto _signal;
	case KBD_CTRL('B'):
		p->goto_current(-get_terminal_lines());
		goto _signal;
	case KBD_CTRL('U'):
		p->goto_current(-get_terminal_lines() / 2);
		goto _signal;
	case KBD_CTRL('F'):
		p->goto_current(get_terminal_lines());
		goto _signal;
	case KBD_CTRL('D'):
		p->goto_current(get_terminal_lines() / 2);
		goto _signal;
	default:
		goto _signal;
	}
	return;
_signal:
	p->signal();
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %r14
movq 0x18(%rdi), %rax
movq (%rax), %rbx
cmpl $0x67, %esi
jle 0x4d0c
leal -0x68(%rsi), %eax
cmpl $0x4, %eax
jbe 0x4d60
leal -0x102(%rsi), %eax
cmpl $0x3, %eax
ja 0x4dbe
leaq 0x3865(%rip), %rcx      # 0x8568
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
cmpl $0xb, %esi
jg 0x4d34
incl %esi
cmpl $0x7, %esi
ja 0x4e11
leaq 0x3811(%rip), %rax      # 0x8534
movslq (%rax,%rsi,4), %rcx
addq %rax, %rcx
jmpq *%rcx
addq $0x8, %rsp
popq %rbx
popq %r14
retq
cmpl $0x23, %esi
jg 0x4d7f
cmpl $0xc, %esi
je 0x4dc6
cmpl $0x15, %esi
jne 0x4e11
callq 0x6c81
movl %eax, %esi
shrl $0x1f, %esi
addl %eax, %esi
sarl %esi
negl %esi
jmp 0x4dfb
leaq 0x37ed(%rip), %rcx      # 0x8554
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq %r14, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x4960
cmpl $0x24, %esi
je 0x4e20
cmpl $0x30, %esi
jne 0x4e11
movq %rbx, %rdi
callq 0x59b2
jmp 0x4e11
movq %r14, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x4904
movq %rbx, %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
jmp 0x4e0c
movq %rbx, %rdi
movl $0x1, %esi
jmp 0x4e0c
cmpl $0x19a, %esi            # imm = 0x19A
jne 0x4e11
callq 0x6c1b
leaq 0x7620(%rip), %rax      # 0xc3f2
cmpb $0x0, (%rax)
je 0x4e2a
movq %r14, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x4ad2
callq 0x6c81
jmp 0x4e07
callq 0x6c81
movl %eax, %esi
shrl $0x1f, %esi
addl %eax, %esi
sarl %esi
movq %rbx, %rdi
jmp 0x4e0c
callq 0x6c81
negl %eax
movq %rbx, %rdi
movl %eax, %esi
callq 0x59ea
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x5c1c
movq %rbx, %rdi
callq 0x59cc
jmp 0x4e11
movq %r14, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x49be
nop
// File: /workspace/github_cpp_makefile_star2_O1/kusumi[P]procstat/container.cc
// Function: Container::thread_create()
int Container::thread_create(void)
{
	int ret = _thread.create(watch_thread_handler, 0);
	if (ret) {
		log("create thread failed %d", ret);
		return ret;
	}

	for (size_t i = 0; i < _v.size(); i++) {
		ret = _v[i]->create();
		if (ret) {
			log("window=%p create thread failed %d",
				static_cast<void*>(_v[i]), ret);
			return ret;
		}
	}
	return 0;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdi, %rbx
leaq 0x7667(%rip), %rdi      # 0xc4b0
leaq 0x50(%rip), %rdx        # 0x4ea0
xorl %r14d, %r14d
xorl %esi, %esi
xorl %ecx, %ecx
callq 0x36b0
testl %eax, %eax
je 0x4e6c
movl %eax, %r14d
movl %r14d, %eax
popq %rbx
popq %r14
popq %r15
retq
movq (%rbx), %rax
cmpq %rax, 0x8(%rbx)
je 0x4e63
xorl %r15d, %r15d
movq (%rax,%r15,8), %rdi
callq 0x5c66
testl %eax, %eax
jne 0x4e60
incq %r15
movq (%rbx), %rax
movq 0x8(%rbx), %rcx
subq %rax, %rcx
sarq $0x3, %rcx
cmpq %rcx, %r15
jb 0x4e78
xorl %r14d, %r14d
jmp 0x4e63
// File: /workspace/github_cpp_makefile_star2_O1/kusumi[P]procstat/container.cc
// Function: watch_thread_handler(void*)
static void *watch_thread_handler(void *arg)
{
	log("thread=%lu", get_thread_id());
	while (!interrupted) {
		watch_res r;
		if (read_watch(r) > 0) {
			for (watch_res::iterator it = r.begin(); it != r.end();
				it++) {
				Window *p = _map[it->first];
				switch (it->second) {
				case WATCH_MODIFY:
					p->update_buffer();
					break;
				}
			}
			flash_terminal();
		}
		_mutex.timedwait(1, 0);
	}
	return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
leaq 0x750f(%rip), %r13      # 0xc3c4
cmpl $0x0, (%r13)
jne 0x4f5e
leaq 0x10(%rsp), %rbp
xorl %r15d, %r15d
leaq 0x8(%rsp), %rbx
leaq 0x75ac(%rip), %r14      # 0xc480
movl $0x0, 0x10(%rsp)
movq %r15, 0x18(%rsp)
movq %rbp, 0x20(%rsp)
movq %rbp, 0x28(%rsp)
movq %r15, 0x30(%rsp)
movq %rbx, %rdi
callq 0x70c8
testl %eax, %eax
jle 0x4f38
movq 0x20(%rsp), %r12
cmpq %rbp, %r12
je 0x4f33
leaq 0x20(%r12), %rsi
movq %r14, %rdi
callq 0x50ee
cmpl $0x1, 0x24(%r12)
jne 0x4f23
movq (%rax), %rdi
callq 0x5972
movq %r12, %rdi
callq 0x3270
movq %rax, %r12
cmpq %rbp, %rax
jne 0x4f06
callq 0x6cd9
movl $0x1, %esi
leaq 0x74e4(%rip), %rdi      # 0xc428
xorl %edx, %edx
callq 0x697a
movq %rbx, %rdi
callq 0x5358
cmpl $0x0, (%r13)
je 0x4ed4
xorl %eax, %eax
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x4f71
movq %rax, %rbx
leaq 0x8(%rsp), %rdi
callq 0x5358
movq %rbx, %rdi
callq 0x3680
// File: /workspace/github_cpp_makefile_star2_O1/kusumi[P]procstat/container.cc
// Function: Container::thread_join()
void Container::thread_join(void)
{
	int ret;
	for (size_t i = 0; i < _v.size(); i++)
		_v[i]->signal();
	for (size_t i = 0; i < _v.size(); i++) {
		ret = _v[i]->join();
		if (ret)
			log("window=%p join thread failed %d",
				static_cast<void*>(_v[i]), ret);
	}

	_mutex.signal();
	ret = _thread.join();
	if (ret)
		log("join thread failed %d", ret);
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x10, %rsp
movq %rdi, %rbx
movq (%rdi), %rax
cmpq %rax, 0x8(%rdi)
je 0x4fbd
xorl %r14d, %r14d
movq (%rax,%r14,8), %rdi
callq 0x5c1c
incq %r14
movq (%rbx), %rax
movq 0x8(%rbx), %rcx
subq %rax, %rcx
sarq $0x3, %rcx
cmpq %rcx, %r14
jb 0x4f9e
movq (%rbx), %rax
cmpq %rax, 0x8(%rbx)
je 0x4ff4
xorl %r15d, %r15d
leaq 0x8(%rsp), %r14
movq (%rax,%r15,8), %rax
movq 0x58(%rax), %rdi
movq %r14, %rsi
callq 0x3320
incq %r15
movq (%rbx), %rax
movq 0x8(%rbx), %rcx
subq %rax, %rcx
sarq $0x3, %rcx
cmpq %rcx, %r15
jb 0x4fce
leaq 0x7455(%rip), %rdi      # 0xc450
callq 0x3030
movq 0x74a9(%rip), %rdi      # 0xc4b0
leaq 0x8(%rsp), %rsi
callq 0x3320
addq $0x10, %rsp
popq %rbx
popq %r14
popq %r15
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/kusumi[P]procstat/window.cc
// Function: Window::Window(int, int, int, int)
Window::Window(int ylen, int xlen, int ypos, int xpos):
	_frame(0),
	_panel(0),
	_buffer(0),
	_offset(0)
{
	_frame = new Frame(ylen, xlen, ypos, xpos);
	_panel = new Panel(ylen - 2, xlen - 2, ypos + 1, xpos + 1);
	_frame->refresh();
	_panel->refresh();
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %r8d, %ebp
movl %ecx, %r15d
movl %edx, %r12d
movl %esi, %r13d
movq %rdi, %rbx
xorl %esi, %esi
callq 0x3550
leaq 0x28(%rbx), %rdi
movq %rdi, (%rsp)
xorl %esi, %esi
callq 0x3470
xorps %xmm0, %xmm0
movups %xmm0, 0x60(%rbx)
movups %xmm0, 0x6c(%rbx)
movl $0x48, %edi
callq 0x3360
movq %rax, %r14
movq %rax, %rdi
movl %r13d, %esi
movl %r12d, %edx
movl %r15d, %ecx
movl %ebp, %r8d
callq 0x5fa6
leaq 0x60(%rbx), %rax
movq %r14, (%rax)
movl $0x20, %edi
callq 0x3360
movq %rax, %r14
addl $-0x2, %r13d
addl $-0x2, %r12d
incl %r15d
incl %ebp
movq %rax, %rdi
movl %r13d, %esi
movl %r12d, %edx
movl %r15d, %ecx
movl %ebp, %r8d
callq 0x5ee8
movq %r14, 0x68(%rbx)
movq 0x60(%rbx), %rax
movq 0x8(%rax), %rdi
callq 0x6e5a
movq 0x68(%rbx), %rax
movq 0x8(%rax), %rdi
callq 0x6e5a
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %r15
movl $0x20, %esi
jmp 0x56f0
movq %rax, %r15
movl $0x48, %esi
movq %r14, %rdi
callq 0x3380
jmp 0x56fd
movq %rax, %r15
movq (%rsp), %rdi
callq 0x36e0
movq %rbx, %rdi
callq 0x3450
movq %r15, %rdi
callq 0x3680
// File: /workspace/github_cpp_makefile_star2_O1/kusumi[P]procstat/window.cc
// Function: Window::~Window()
Window::~Window(void)
{
	delete _buffer;
	delete _frame;
	delete _panel;
	log("window=%p", static_cast<void*>(this));
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq 0x70(%rdi), %r14
testq %r14, %r14
je 0x573b
movq %r14, %rdi
callq 0x5d98
movl $0x2a8, %esi            # imm = 0x2A8
movq %r14, %rdi
callq 0x3380
movq 0x60(%rbx), %rdi
testq %rdi, %rdi
je 0x574a
movq (%rdi), %rax
callq *0x8(%rax)
movq 0x68(%rbx), %rdi
testq %rdi, %rdi
je 0x5759
movq (%rdi), %rax
callq *0x8(%rax)
leaq 0x28(%rbx), %rdi
callq 0x36e0
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x3450
nop
// File: /workspace/github_cpp_makefile_star2_O1/kusumi[P]procstat/window.cc
// Function: Window::resize(int, int, int, int)
void Window::resize(int ylen, int xlen, int ypos, int xpos)
{
	_mutex.lock();
	_frame->resize(ylen, xlen, ypos, xpos);
	_panel->resize(ylen - 2, xlen - 2, ypos + 1, xpos + 1);
	_offset = 0;
	_mutex.unlock();
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movl %r8d, %ebp
movl %ecx, %r14d
movl %edx, %r15d
movl %esi, %r12d
movq %rdi, %rbx
callq 0x3530
movq 0x60(%rbx), %rdi
movq (%rdi), %rax
movl %r12d, %esi
movl %r15d, %edx
movl %r14d, %ecx
movl %ebp, %r8d
callq *0x20(%rax)
movq 0x68(%rbx), %rdi
addl $-0x2, %r12d
addl $-0x2, %r15d
incl %r14d
incl %ebp
movq (%rdi), %rax
movl %r12d, %esi
movl %r15d, %edx
movl %r14d, %ecx
movl %ebp, %r8d
callq *0x20(%rax)
movl $0x0, 0x78(%rbx)
movq %rbx, %rdi
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0x32c0