LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_cpp_makefile_star2_O2/tomfunkhouser[P]gaps/pkgs/R3Shapes/R3MeshProperty.cpp
// Function: gaps::R3MeshProperty::DistanceTransform()
void R3MeshProperty::
DistanceTransform(void)
{
  // Create array of source vertices
  RNArray<R3MeshVertex *> vertices;
  for (int i = 0; i < mesh->NVertices(); i++) {
    if (values[i] == 0) continue;
    if (values[i] == RN_UNKNOWN) continue;
    R3MeshVertex *vertex = mesh->Vertex(i);
    vertices.Insert(vertex);
  }

  // Compute distances to those vertices
  RNLength *distances = mesh->DijkstraDistances(vertices);

  // Fill property
  for (int i = 0; i < mesh->NVertices(); i++) {
    if (values[i] == RN_UNKNOWN) continue;
    values[i] = distances[i];
  }

  // Delete distances
  delete [] distances;

  // Reset statistics
  ResetStatistics();
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x10, %rsp
movq %rdi, %rbx
movq %rsp, %r14
movq %r14, %rdi
callq 0x8001e
xorl %r15d, %r15d
xorpd %xmm1, %xmm1
movq (%rbx), %rdi
movslq 0x14(%rdi), %rax
cmpq %rax, %r15
jge 0x4406e
movq 0x410(%rbx), %rax
movsd (%rax,%r15,8), %xmm0
ucomisd %xmm1, %xmm0
jne 0x44049
jnp 0x44069
ucomisd 0x85037(%rip), %xmm0    # 0xc9088
jne 0x44055
jnp 0x44069
movq 0x8(%rdi), %rax
movq (%rax,%r15,8), %rsi
movq %r14, %rdi
callq 0x26aa0
xorpd %xmm1, %xmm1
incq %r15
jmp 0x44028
xorl %r14d, %r14d
movq %rsp, %rsi
xorpd %xmm0, %xmm0
xorl %edx, %edx
callq 0x57d4e
movq (%rbx), %rcx
movl 0x14(%rcx), %ecx
movq 0x410(%rbx), %rdx
testl %ecx, %ecx
cmovlel %r14d, %ecx
cmpq %r14, %rcx
je 0x440ba
movsd (%rdx,%r14,8), %xmm0
ucomisd 0x84fe3(%rip), %xmm0    # 0xc9088
jne 0x440a9
jnp 0x440b5
movsd (%rax,%r14,8), %xmm0
movsd %xmm0, (%rdx,%r14,8)
incq %r14
jmp 0x44092
testq %rax, %rax
je 0x440c7
movq %rax, %rdi
callq 0x21c00
movaps 0x87332(%rip), %xmm0    # 0xcb400
movups %xmm0, 0x418(%rbx)
movups %xmm0, 0x428(%rbx)
movups %xmm0, 0x438(%rbx)
movq %rsp, %rdi
callq 0x8008c
addq $0x10, %rsp
popq %rbx
popq %r14
popq %r15
retq
jmp 0x440f7
movq %rax, %rbx
movq %rsp, %rdi
callq 0x8008c
movq %rbx, %rdi
callq 0x220c0
// File: /workspace/github_cpp_makefile_star2_O2/tomfunkhouser[P]gaps/pkgs/R3Shapes/R3MeshProperty.cpp
// Function: gaps::R3MeshProperty::SetVertexValue(int, double)
void R3MeshProperty::
SetVertexValue(int vertex_index, RNScalar value)
{
  // Set vertex value
  values[vertex_index] = value;

  // Reset statistics
  ResetStatistics();
}

// Assembly:
movq 0x410(%rdi), %rax
movslq %esi, %rcx
movsd %xmm0, (%rax,%rcx,8)
movaps 0x870ca(%rip), %xmm0    # 0xcb400
movups %xmm0, 0x418(%rdi)
movups %xmm0, 0x428(%rdi)
movups %xmm0, 0x438(%rdi)
retq
// File: /workspace/github_cpp_makefile_star2_O2/tomfunkhouser[P]gaps/pkgs/R3Shapes/R3MeshProperty.cpp
// Function: gaps::R3MeshProperty::Threshold(double, double, double)
void R3MeshProperty::
Threshold(RNScalar threshold, RNScalar low, RNScalar high)
{
  // Threshold every value
  for (int i = 0; i < nvalues; i++) {
    if (values[i] == RN_UNKNOWN) continue;
    if (values[i] <= threshold) {
      if (low != R3_MESH_PROPERTY_KEEP_VALUE) values[i] = low;
    }
    else {
      if (high != R3_MESH_PROPERTY_KEEP_VALUE) values[i] = high;
    }
  }

  // Reset statistics
  ResetStatistics();
}

// Assembly:
movslq 0x408(%rdi), %rax
movq 0x410(%rdi), %rcx
xorl %edx, %edx
movsd 0x84d10(%rip), %xmm3    # 0xc9088
movsd 0x870a8(%rip), %xmm4    # 0xcb428
cmpq %rax, %rdx
jge 0x443b8
movsd (%rcx,%rdx,8), %xmm5
ucomisd %xmm3, %xmm5
jne 0x44392
jnp 0x443b3
ucomisd %xmm5, %xmm0
jae 0x443a2
ucomisd %xmm4, %xmm2
movapd %xmm2, %xmm5
jmp 0x443aa
ucomisd %xmm4, %xmm1
movapd %xmm1, %xmm5
jne 0x443ae
jnp 0x443b3
movsd %xmm5, (%rcx,%rdx,8)
incq %rdx
jmp 0x44380
movaps 0x87041(%rip), %xmm0    # 0xcb400
movups %xmm0, 0x418(%rdi)
movups %xmm0, 0x428(%rdi)
movups %xmm0, 0x438(%rdi)
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/tomfunkhouser[P]gaps/pkgs/R3Shapes/R3MeshProperty.cpp
// Function: gaps::R3MeshProperty::AddVertexValue(int, double)
void R3MeshProperty::
AddVertexValue(int vertex_index, RNScalar value)
{
  // Add value to a vertex
  if (values[vertex_index] == RN_UNKNOWN) values[vertex_index] = value;
  else values[vertex_index] += value;

  // Reset statistics
  ResetStatistics();
}

// Assembly:
movq 0x410(%rdi), %rax
movslq %esi, %rcx
movsd (%rax,%rcx,8), %xmm1
movapd %xmm1, %xmm2
addsd %xmm0, %xmm2
cmpeqsd 0x84c92(%rip), %xmm1    # 0xc9088
movapd %xmm1, %xmm3
andnpd %xmm2, %xmm3
andpd %xmm0, %xmm1
orpd %xmm3, %xmm1
movlpd %xmm1, (%rax,%rcx,8)
movaps 0x86fee(%rip), %xmm0    # 0xcb400
movups %xmm0, 0x418(%rdi)
movups %xmm0, 0x428(%rdi)
movups %xmm0, 0x438(%rdi)
retq
// File: /workspace/github_cpp_makefile_star2_O2/tomfunkhouser[P]gaps/pkgs/R3Shapes/R3MeshProperty.cpp
// Function: gaps::R3MeshProperty::AddVertexValue(gaps::R3MeshVertex*, double)
void R3MeshProperty::
AddVertexValue(R3MeshVertex *vertex, RNScalar value)
{
  // Add value to a vertex
  AddVertexValue(mesh->VertexID(vertex), value);

  // Reset statistics
  ResetStatistics();
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
movl 0x70(%rsi), %esi
callq 0x443d6
movaps 0x86fc5(%rip), %xmm0    # 0xcb400
movups %xmm0, 0x418(%rbx)
movups %xmm0, 0x428(%rbx)
movups %xmm0, 0x438(%rbx)
popq %rbx
retq
// File: /workspace/github_cpp_makefile_star2_O2/tomfunkhouser[P]gaps/pkgs/R3Shapes/R3MeshProperty.cpp
// Function: gaps::R3MeshProperty::Normalize()
void R3MeshProperty::
Normalize(void)
{
  // Get mean and stddev
  RNScalar m = Mean();
  RNScalar s = StandardDeviation();

  // Check stddev
  if (s == 0) {
    // Set everything to zero
    for (int i = 0; i < nvalues; i++) {
      if (values[i] == RN_UNKNOWN) continue;
      values[i] = 0;
    }
  }
  else {
    // Normalize by mean and stddev
    for (int i = 0; i < nvalues; i++) {
      if (values[i] == RN_UNKNOWN) continue;
      values[i] = (values[i] - m) / s;
    }
  }

  // Reset statistics
  ResetStatistics();
}

// Assembly:
pushq %rbx
subq $0x10, %rsp
movq %rdi, %rbx
callq 0x4315a
movsd %xmm0, 0x8(%rsp)
movq %rbx, %rdi
callq 0x432e8
movl 0x408(%rbx), %ecx
xorl %eax, %eax
testl %ecx, %ecx
cmovgl %ecx, %eax
xorpd %xmm1, %xmm1
ucomisd %xmm1, %xmm0
movq 0x410(%rbx), %rcx
jne 0x444f9
jp 0x444f9
xorl %edx, %edx
movsd 0x84bab(%rip), %xmm0    # 0xc9088
cmpq %rdx, %rax
je 0x4452d
movsd (%rcx,%rdx,8), %xmm1
ucomisd %xmm0, %xmm1
jne 0x444ef
jnp 0x444f4
andq $0x0, (%rcx,%rdx,8)
incq %rdx
jmp 0x444dd
xorl %edx, %edx
movsd 0x84b85(%rip), %xmm1    # 0xc9088
movsd 0x8(%rsp), %xmm3
cmpq %rdx, %rax
je 0x4452d
movsd (%rcx,%rdx,8), %xmm2
ucomisd %xmm1, %xmm2
jne 0x4451b
jnp 0x44528
subsd %xmm3, %xmm2
divsd %xmm0, %xmm2
movsd %xmm2, (%rcx,%rdx,8)
incq %rdx
jmp 0x44509
movaps 0x86ecc(%rip), %xmm0    # 0xcb400
movups %xmm0, 0x418(%rbx)
movups %xmm0, 0x428(%rbx)
movups %xmm0, 0x438(%rbx)
addq $0x10, %rsp
popq %rbx
retq
// File: /workspace/github_cpp_makefile_star2_O2/tomfunkhouser[P]gaps/pkgs/R3Shapes/R3MeshProperty.cpp
// Function: gaps::R3MeshProperty::Percentilize()
void R3MeshProperty::
Percentilize(void)
{
  // Push vertices onto heap sorted by property value
  RNHeap<R3MeshVertex *> heap(VertexPropertyValueCallback, NULL, this);
  for (int i = 0; i < mesh->NVertices(); i++) {
    if (values[i] == RN_UNKNOWN) continue;
    heap.Push(mesh->Vertex(i));
  }

  // Pop vertices in order, storing perecentiles
  for (int i = 0; i < mesh->NVertices(); i++) {
    if (heap.IsEmpty()) break;
    R3MeshVertex *vertex = heap.Pop();
    int vertex_index = mesh->VertexID(vertex);
    values[vertex_index] = 100.0 * i / mesh->NVertices();
  }

  // Reset statistics
  ResetStatistics();
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x38, %rsp
movq %rdi, %rbx
xorpd %xmm0, %xmm0
movq %rsp, %r14
movapd %xmm0, (%r14)
orq $-0x1, 0x10(%r14)
leaq -0x36(%rip), %rax       # 0x4454f
movq %rax, 0x18(%r14)
andq $0x0, 0x20(%r14)
movq %rdi, 0x28(%r14)
movl $0x1, 0x30(%r14)
xorl %r15d, %r15d
movsd 0x84ae3(%rip), %xmm1    # 0xc9088
movq (%rbx), %rcx
movslq 0x14(%rcx), %rax
cmpq %rax, %r15
jge 0x445e3
movq 0x410(%rbx), %rax
movsd (%rax,%r15,8), %xmm0
ucomisd %xmm1, %xmm0
jne 0x445c6
jnp 0x445de
movq 0x8(%rcx), %rax
movq (%rax,%r15,8), %rsi
movq %r14, %rdi
callq 0x4563e
movsd 0x84aaa(%rip), %xmm1    # 0xc9088
incq %r15
jmp 0x445a5
xorl %ebp, %ebp
movq %rsp, %r14
cmpl %eax, %ebp
jge 0x44629
cmpl $0x0, 0x8(%rsp)
je 0x44629
movq %r14, %rdi
callq 0x45746
movslq 0x70(%rax), %rcx
movq (%rbx), %rax
cvtsi2sd %ebp, %xmm0
movl 0x14(%rax), %eax
mulsd 0x84a87(%rip), %xmm0    # 0xc9098
cvtsi2sd %eax, %xmm1
divsd %xmm1, %xmm0
movq 0x410(%rbx), %rdx
movsd %xmm0, (%rdx,%rcx,8)
incl %ebp
jmp 0x445e8
movaps 0x86dd0(%rip), %xmm0    # 0xcb400
movups %xmm0, 0x418(%rbx)
movups %xmm0, 0x428(%rbx)
movups %xmm0, 0x438(%rbx)
movq %rsp, %rdi
callq 0x457e6
addq $0x38, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
jmp 0x4465a
movq %rax, %rbx
movq %rsp, %rdi
callq 0x457e6
movq %rbx, %rdi
callq 0x220c0
nop
// File: /workspace/github_cpp_makefile_star2_O2/tomfunkhouser[P]gaps/pkgs/R3Shapes/R3MeshProperty.cpp
// Function: gaps::R3MeshProperty::Laplace()
void R3MeshProperty::
Laplace(void)
{
  // Assign laplacian  at every vertex
  R3MeshProperty copy(*this);
  for (int i = 0; i < mesh->NVertices(); i++) {
    R3MeshVertex *vertex = mesh->Vertex(i);
    if (values[i] == RN_UNKNOWN) continue;
    SetVertexValue(vertex, copy.Laplacian(vertex));
  }

  // Reset statistics
  ResetStatistics();
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x448, %rsp            # imm = 0x448
movq %rdi, %rbx
movq %rsp, %r14
movq %r14, %rdi
movq %rbx, %rsi
callq 0x42bdc
xorl %r12d, %r12d
movq (%rbx), %rax
movslq 0x14(%rax), %rcx
cmpq %rcx, %r12
jge 0x446fd
movq 0x410(%rbx), %rcx
movsd (%rcx,%r12,8), %xmm0
ucomisd 0x849d7(%rip), %xmm0    # 0xc9088
jne 0x446b5
jnp 0x446f8
movq 0x8(%rax), %rax
movq (%rax,%r12,8), %r15
movq %r14, %rdi
movq %r15, %rsi
callq 0x42e48
movslq 0x70(%r15), %rax
movq 0x410(%rbx), %rcx
movsd %xmm0, (%rcx,%rax,8)
movapd 0x86d20(%rip), %xmm0    # 0xcb400
movupd %xmm0, 0x418(%rbx)
movupd %xmm0, 0x428(%rbx)
movupd %xmm0, 0x438(%rbx)
incq %r12
jmp 0x44690
movaps 0x86cfc(%rip), %xmm0    # 0xcb400
movups %xmm0, 0x418(%rbx)
movups %xmm0, 0x428(%rbx)
movups %xmm0, 0x438(%rbx)
movq %rsp, %rdi
callq 0x42c80
addq $0x448, %rsp            # imm = 0x448
popq %rbx
popq %r12
popq %r14
popq %r15
retq
movq %rax, %rbx
movq %rsp, %rdi
callq 0x42c80
movq %rbx, %rdi
callq 0x220c0
nop
// File: /workspace/github_cpp_makefile_star2_O2/tomfunkhouser[P]gaps/pkgs/R3Shapes/R3MeshProperty.cpp
// Function: gaps::R3MeshProperty::Dilate(double)
void R3MeshProperty::
Dilate(RNScalar radius)
{
  // Copy property
  R3MeshProperty copy(*this);
  
  // Clear property
  Clear(0);
 
  // For every vertex with non-zero value
  for (int i = 0; i < mesh->NVertices(); i++) {
    if (copy.VertexValue(i) == 0) continue;
    if (copy.VertexValue(i) == RN_UNKNOWN) continue;
    R3MeshVertex *vertex = mesh->Vertex(i);

    // Find neighborhood of vertex
    RNArray<R3MeshVertex *> neighbor_vertices;
    RNLength *distances = mesh->DijkstraDistances(vertex, radius, neighbor_vertices);
    delete [] distances;

    // Set value of vertices within neighborhood
    for (int j = 0; j < neighbor_vertices.NEntries(); j++) {
      R3MeshVertex *neighbor_vertex = neighbor_vertices.Kth(j);
      if (VertexValue(neighbor_vertex) == RN_UNKNOWN) continue;
      SetVertexValue(neighbor_vertex, 1);
    }
  }

  // Reset statistics
  ResetStatistics();
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x460, %rsp            # imm = 0x460
movsd %xmm0, (%rsp)
movq %rdi, %rbx
leaq 0x18(%rsp), %rdi
movq %rbx, %rsi
callq 0x42bdc
xorpd %xmm0, %xmm0
movq %rbx, %rdi
callq 0x43a8c
xorl %r12d, %r12d
movsd 0x84908(%rip), %xmm2    # 0xc9088
leaq 0x8(%rsp), %r14
movabsq $0x3ff0000000000000, %r13 # imm = 0x3FF0000000000000
movaps 0x86c6a(%rip), %xmm1    # 0xcb400
movq (%rbx), %rax
movslq 0x14(%rax), %rcx
cmpq %rcx, %r12
jge 0x4487b
movq 0x428(%rsp), %rcx
movsd (%rcx,%r12,8), %xmm0
ucomisd 0x866a4(%rip), %xmm0    # 0xcae60
jne 0x447c4
jnp 0x44873
ucomisd %xmm2, %xmm0
jne 0x447d0
jnp 0x44873
movq 0x8(%rax), %rax
movq (%rax,%r12,8), %r15
movq %r14, %rdi
callq 0x8001e
movq (%rbx), %rdi
movq %r15, %rsi
movsd (%rsp), %xmm0
movq %r14, %rdx
xorl %ecx, %ecx
callq 0x57fd8
testq %rax, %rax
je 0x44802
movq %rax, %rdi
callq 0x21c00
movslq 0x14(%rsp), %rax
movq 0x8(%rsp), %rcx
movq 0x410(%rbx), %rdx
xorl %esi, %esi
movaps 0x86be4(%rip), %xmm1    # 0xcb400
movsd 0x84864(%rip), %xmm2    # 0xc9088
cmpq %rax, %rsi
jge 0x4485c
movq (%rcx,%rsi,8), %rdi
movslq 0x70(%rdi), %rdi
movsd (%rdx,%rdi,8), %xmm0
ucomisd %xmm2, %xmm0
jne 0x4483e
jnp 0x44857
movq %r13, (%rdx,%rdi,8)
movups %xmm1, 0x418(%rbx)
movups %xmm1, 0x428(%rbx)
movups %xmm1, 0x438(%rbx)
incq %rsi
jmp 0x44824
movq %r14, %rdi
callq 0x8008c
movsd 0x8481c(%rip), %xmm2    # 0xc9088
movaps 0x86b8d(%rip), %xmm1    # 0xcb400
incq %r12
jmp 0x44796
movups %xmm1, 0x418(%rbx)
movups %xmm1, 0x428(%rbx)
movups %xmm1, 0x438(%rbx)
leaq 0x18(%rsp), %rdi
callq 0x42c80
addq $0x460, %rsp            # imm = 0x460
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
movq %rax, %rbx
leaq 0x8(%rsp), %rdi
callq 0x8008c
jmp 0x448bd
movq %rax, %rbx
leaq 0x18(%rsp), %rdi
callq 0x42c80
movq %rbx, %rdi
callq 0x220c0
nop
// File: /workspace/github_cpp_makefile_star2_O2/tomfunkhouser[P]gaps/pkgs/R3Shapes/R3MeshProperty.cpp
// Function: gaps::R3MeshProperty::Erode(double)
void R3MeshProperty::
Erode(RNScalar radius)
{
  // Flip values
  for (int i = 0; i < mesh->NVertices(); i++) {
    if (VertexValue(i) == RN_UNKNOWN) continue;
    if (VertexValue(i) == 0) SetVertexValue(i, 1);
    else SetVertexValue(i, 0);
  }

  // Dilate
  Dilate(radius);

  // Flip values
  for (int i = 0; i < mesh->NVertices(); i++) {
    if (VertexValue(i) == RN_UNKNOWN) continue;
    if (VertexValue(i) == 0) SetVertexValue(i, 1);
    else SetVertexValue(i, 0);
  }

  // Reset statistics
  ResetStatistics();
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
movq (%rdi), %rax
movslq 0x14(%rax), %rax
movq 0x410(%rdi), %rcx
xorl %edx, %edx
xorpd %xmm1, %xmm1
movsd 0x84730(%rip), %xmm4    # 0xc9020
movapd 0x86b08(%rip), %xmm3    # 0xcb400
cmpq %rax, %rdx
jge 0x44939
movsd (%rcx,%rdx,8), %xmm2
ucomisd 0x8477e(%rip), %xmm2    # 0xc9088
jne 0x4490e
jnp 0x44934
cmpeqsd %xmm1, %xmm2
andpd %xmm4, %xmm2
movlpd %xmm2, (%rcx,%rdx,8)
movupd %xmm3, 0x418(%rbx)
movupd %xmm3, 0x428(%rbx)
movupd %xmm3, 0x438(%rbx)
incq %rdx
jmp 0x448f8
movq %rbx, %rdi
callq 0x44744
movsd 0x846d7(%rip), %xmm4    # 0xc9020
movsd 0x84737(%rip), %xmm3    # 0xc9088
movapd 0x86aa7(%rip), %xmm2    # 0xcb400
movq (%rbx), %rax
movslq 0x14(%rax), %rax
movq 0x410(%rbx), %rcx
xorl %edx, %edx
xorpd %xmm0, %xmm0
cmpq %rax, %rdx
jge 0x449aa
movsd (%rcx,%rdx,8), %xmm1
ucomisd %xmm3, %xmm1
jne 0x4497f
jnp 0x449a5
cmpeqsd %xmm0, %xmm1
andpd %xmm4, %xmm1
movlpd %xmm1, (%rcx,%rdx,8)
movupd %xmm2, 0x418(%rbx)
movupd %xmm2, 0x428(%rbx)
movupd %xmm2, 0x438(%rbx)
incq %rdx
jmp 0x4496d
movupd %xmm2, 0x418(%rbx)
movupd %xmm2, 0x428(%rbx)
movupd %xmm2, 0x438(%rbx)
popq %rbx
retq
// File: /workspace/github_cpp_makefile_star2_O2/tomfunkhouser[P]gaps/pkgs/R3Shapes/R3MeshProperty.cpp
// Function: gaps::R3MeshProperty::DoG(double)
void R3MeshProperty::
DoG(RNScalar sigma)
{
  // Difference of Gaussians
  // Replace values with difference from blurred version
  R3MeshProperty blur(*this); 
  blur.Blur(sigma);
  Subtract(blur);

  // Reset statistics
  ResetStatistics();
}

// Assembly:
pushq %r14
pushq %rbx
subq $0x458, %rsp            # imm = 0x458
movsd %xmm0, 0x8(%rsp)
movq %rdi, %rbx
leaq 0x10(%rsp), %r14
movq %r14, %rdi
movq %rbx, %rsi
callq 0x42bdc
movq %r14, %rdi
movsd 0x8(%rsp), %xmm0
callq 0x449c4
leaq 0x10(%rsp), %r14
movq %rbx, %rdi
movq %r14, %rsi
callq 0x43ce6
movaps 0x867c4(%rip), %xmm0    # 0xcb400
movups %xmm0, 0x418(%rbx)
movups %xmm0, 0x428(%rbx)
movups %xmm0, 0x438(%rbx)
movq %r14, %rdi
callq 0x42c80
addq $0x458, %rsp            # imm = 0x458
popq %rbx
popq %r14
retq
movq %rax, %rbx
leaq 0x10(%rsp), %rdi
callq 0x42c80
movq %rbx, %rdi
callq 0x220c0
nop
// File: /workspace/github_cpp_makefile_star2_O2/tomfunkhouser[P]gaps/pkgs/R3Shapes/R3MeshProperty.cpp
// Function: gaps::R3MeshProperty::Strength(double)
void R3MeshProperty::
Strength(RNScalar sigma)
{
  // Replace values with significance score
  // For now, compute product of value and DoG
  R3MeshProperty dog(*this); 
  dog.DoG(sigma);
  dog.Abs();
  Multiply(dog);

  // Reset statistics
  ResetStatistics();
}

// Assembly:
pushq %r14
pushq %rbx
subq $0x458, %rsp            # imm = 0x458
movsd %xmm0, 0x8(%rsp)
movq %rdi, %rbx
leaq 0x10(%rsp), %r14
movq %r14, %rdi
movq %rbx, %rsi
callq 0x42bdc
movq %r14, %rdi
movsd 0x8(%rsp), %xmm0
callq 0x44bf4
leaq 0x10(%rsp), %r14
movq %r14, %rdi
callq 0x43832
movq %rbx, %rdi
movq %r14, %rsi
callq 0x43daa
movaps 0x86736(%rip), %xmm0    # 0xcb400
movups %xmm0, 0x418(%rbx)
movups %xmm0, 0x428(%rbx)
movups %xmm0, 0x438(%rbx)
movq %r14, %rdi
callq 0x42c80
addq $0x458, %rsp            # imm = 0x458
popq %rbx
popq %r14
retq
movq %rax, %rbx
leaq 0x10(%rsp), %rdi
callq 0x42c80
movq %rbx, %rdi
callq 0x220c0
nop
// File: /workspace/github_cpp_makefile_star2_O2/tomfunkhouser[P]gaps/pkgs/R3Shapes/R3MeshProperty.cpp
// Function: gaps::R3MeshProperty::Reset(gaps::R3Mesh*)
void R3MeshProperty::
Reset(R3Mesh *mesh)
{
  // Set mesh
  this->mesh = mesh;

  // Assign vertex values
  if (values) delete [] values;
  this->nvalues = mesh->NVertices();
  this->values = new RNScalar [ this->nvalues ];
  for (int i = 0; i < mesh->NVertices(); i++) {
    this->values[i] = 0;
  }

  // Reset statistics
  ResetStatistics();
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %r14
movq %rdi, %rbx
movq %rsi, (%rdi)
movq 0x410(%rdi), %rdi
testq %rdi, %rdi
je 0x44d26
callq 0x21c00
movslq 0x14(%r14), %r14
leaq (,%r14,8), %rax
testq %r14, %r14
movl %r14d, 0x408(%rbx)
pushq $-0x1
popq %rdi
cmovnsq %rax, %rdi
callq 0x21040
movq %rax, 0x410(%rbx)
xorl %ecx, %ecx
testl %r14d, %r14d
movl $0x0, %edx
cmovgl %r14d, %edx
cmpq %rcx, %rdx
je 0x44d6c
andq $0x0, (%rax,%rcx,8)
incq %rcx
jmp 0x44d5d
movaps 0x8668d(%rip), %xmm0    # 0xcb400
movups %xmm0, 0x418(%rbx)
movups %xmm0, 0x428(%rbx)
movups %xmm0, 0x438(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_cpp_makefile_star2_O2/tomfunkhouser[P]gaps/pkgs/R3Shapes/R3MeshProperty.cpp
// Function: gaps::R3MeshProperty::operator=(gaps::R3MeshProperty const&)
R3MeshProperty& R3MeshProperty::
operator=(const R3MeshProperty& property)
{
  // Reset everything
  if (values) delete [] values;
  nvalues = 0;
  values = NULL;
  name[0] = '\0';

  // Copy stuff
  mesh = property.mesh;
  mean = property.mean;
  stddev = property.stddev;
  minimum = property.minimum;
  maximum = property.maximum;
  median = property.median;
  l2norm = property.l2norm;

  // Copy name
  strcpy(this->name, property.name);
  
  // Copy vertex values
  this->nvalues = mesh->NVertices();
  this->values = new RNScalar [ this->nvalues ];
  for (int i = 0; i < mesh->NVertices(); i++) {
    this->values[i] = property.values[i];
  }

  // Return this
  return *this;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rsi, %r14
movq %rdi, %rbx
movq 0x410(%rdi), %rdi
testq %rdi, %rdi
je 0x44dac
callq 0x21c00
andl $0x0, 0x408(%rbx)
andq $0x0, 0x410(%rbx)
leaq 0x8(%rbx), %rdi
movb $0x0, 0x8(%rbx)
movq (%r14), %r15
movq %r15, (%rbx)
movups 0x418(%r14), %xmm0
movups %xmm0, 0x418(%rbx)
movups 0x428(%r14), %xmm0
movups %xmm0, 0x428(%rbx)
movups 0x438(%r14), %xmm0
movups %xmm0, 0x438(%rbx)
leaq 0x8(%r14), %rsi
callq 0x21800
movslq 0x14(%r15), %r15
leaq (,%r15,8), %rax
testq %r15, %r15
movl %r15d, 0x408(%rbx)
pushq $-0x1
popq %rdi
cmovnsq %rax, %rdi
callq 0x21040
movq %rax, 0x410(%rbx)
movq 0x410(%r14), %rcx
xorl %edx, %edx
cmpq %r15, %rdx
jge 0x44e45
movsd (%rcx,%rdx,8), %xmm0
movsd %xmm0, (%rax,%rdx,8)
incq %rdx
jmp 0x44e31
movq %rbx, %rax
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O2/tomfunkhouser[P]gaps/pkgs/R3Shapes/R3MeshProperty.cpp
// Function: gaps::R3MeshProperty::Dot(gaps::R3MeshProperty const&) const
RNScalar R3MeshProperty::
Dot(const R3MeshProperty& property) const
{
  // Check if number of values is consistent
  if (nvalues != property.nvalues) return 0;

  // Compute dot product of property "vectors"
  RNScalar dot = 0;
  for (int i = 0; i < nvalues; i++) {
    if (values[i] == RN_UNKNOWN) continue;
    dot += values[i] * property.values[i];
  }

  // Return dot product
  return dot;
}

// Assembly:
movl 0x408(%rdi), %eax
xorpd %xmm0, %xmm0
cmpl 0x408(%rsi), %eax
jne 0x44e9d
movq 0x410(%rdi), %rcx
movq 0x410(%rsi), %rdx
xorl %esi, %esi
testl %eax, %eax
cmovlel %esi, %eax
movsd 0x8420b(%rip), %xmm1    # 0xc9088
cmpq %rsi, %rax
je 0x44e9d
movsd (%rcx,%rsi,8), %xmm2
ucomisd %xmm1, %xmm2
jne 0x44e8f
jnp 0x44e98
mulsd (%rdx,%rsi,8), %xmm2
addsd %xmm2, %xmm0
incq %rsi
jmp 0x44e7d
retq
// File: /workspace/github_cpp_makefile_star2_O2/tomfunkhouser[P]gaps/pkgs/R3Shapes/R3MeshProperty.cpp
// Function: gaps::R3MeshProperty::Read(char const*)
int R3MeshProperty::
Read(const char *filename)
{
  // Parse input filename extension
  const char *extension;
  if (!(extension = strrchr(filename, '.'))) {
    printf("Filename %s has no extension (e.g., .arff)\n", filename);
    return 0;
  }

  // Read file of appropriate type
  if (!strcmp(extension, ".arff")) return ReadARFF(filename);
  else if (!strcmp(extension, ".txt")) return ReadValues(filename);
  else if (!strcmp(extension, ".val")) return ReadValues(filename);
  else if (!strcmp(extension, ".dat")) return ReadValues(filename);
  else if (!strcmp(extension, ".pid")) return ReadPoints(filename);

  // Reset statistics
  ResetStatistics();

  // None of the extensions matched
  RNFail("Unable to read file %s (unrecognized extension: %s)\n", filename, extension);
  return 0;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rsi, %rbx
movq %rdi, %r14
pushq $0x2e
popq %rsi
movq %rbx, %rdi
callq 0x219b0
testq %rax, %rax
je 0x44f5c
movq %rax, %r15
leaq 0x86014(%rip), %rsi     # 0xcaedb
movq %rax, %rdi
callq 0x21d10
testl %eax, %eax
je 0x44f85
leaq 0x84797(%rip), %rsi     # 0xc9675
movq %r15, %rdi
callq 0x21d10
testl %eax, %eax
je 0x44f75
leaq 0x8633c(%rip), %rsi     # 0xcb231
movq %r15, %rdi
callq 0x21d10
testl %eax, %eax
je 0x44f75
leaq 0x8632e(%rip), %rsi     # 0xcb236
movq %r15, %rdi
callq 0x21d10
testl %eax, %eax
je 0x44f75
leaq 0x84488(%rip), %rsi     # 0xc93a3
movq %r15, %rdi
callq 0x21d10
testl %eax, %eax
je 0x44f95
movaps 0x864d2(%rip), %xmm0    # 0xcb400
movups %xmm0, 0x418(%r14)
movups %xmm0, 0x428(%r14)
movups %xmm0, 0x438(%r14)
leaq 0x84748(%rip), %rdi     # 0xc9695
movq %rbx, %rsi
movq %r15, %rdx
xorl %eax, %eax
callq 0x82696
jmp 0x44f6d
leaq 0x85f4c(%rip), %rdi     # 0xcaeaf
movq %rbx, %rsi
xorl %eax, %eax
callq 0x21080
xorl %eax, %eax
popq %rbx
popq %r14
popq %r15
retq
movq %r14, %rdi
movq %rbx, %rsi
popq %rbx
popq %r14
popq %r15
jmp 0x451e6
movq %r14, %rdi
movq %rbx, %rsi
popq %rbx
popq %r14
popq %r15
jmp 0x44fa6
movq %r14, %rdi
movq %rbx, %rsi
popq %rbx
popq %r14
popq %r15
jmp 0x452f0
nop
// File: /workspace/github_cpp_makefile_star2_O2/tomfunkhouser[P]gaps/pkgs/R3Shapes/R3MeshProperty.cpp
// Function: gaps::R3MeshProperty::ReadValues(char const*)
int R3MeshProperty::
ReadValues(const char *filename)
{
  // Open file
  FILE *fp = fopen(filename, "r");
  if (!fp) {
    RNFail("Unable to open ASCII file: %s\n", filename);
    return 0;
  }

  // Create property name
  char name[1024];
  strcpy(name, filename);
  char *start = strrchr(name, '/');
  if (start) start++; 
  else start = name;
  char *end = strrchr(start, '.');
  if (end) *end = '\0';

  // Read data 
  double value;
  int vertex_index = 0;
  while (fscanf(fp, "%lf", &value) == (unsigned int) 1) {
    if (vertex_index >= mesh->NVertices()) {
      RNFail("Too many data lines in %s\n", filename);
      return 0;
    }
    SetVertexValue(vertex_index, value);
    vertex_index++;
  }

  // Close file
  fclose(fp);

  // Return success
  return 1;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x418, %rsp            # imm = 0x418
movq %rsi, %rbx
movq %rdi, %r14
leaq 0x8b0ef(%rip), %rsi     # 0xd02f3
movq %rbx, %rdi
callq 0x21a90
testq %rax, %rax
je 0x452b3
movq %rax, %r15
leaq 0x10(%rsp), %r12
movq %r12, %rdi
movq %rbx, %rsi
callq 0x21800
pushq $0x2f
popq %rsi
movq %r12, %rdi
callq 0x219b0
leaq 0x1(%rax), %rdi
testq %rax, %rax
cmoveq %r12, %rdi
pushq $0x2e
popq %rsi
callq 0x219b0
testq %rax, %rax
je 0x4524e
movb $0x0, (%rax)
leaq 0x86685(%rip), %r12     # 0xcb8da
leaq 0x8(%rsp), %r13
xorl %ebp, %ebp
movq %r15, %rdi
movq %r12, %rsi
movq %r13, %rdx
xorl %eax, %eax
callq 0x22190
cmpl $0x1, %eax
jne 0x452bc
movq (%r14), %rax
movslq 0x14(%rax), %rax
cmpq %rax, %rbp
jge 0x452c9
movsd 0x8(%rsp), %xmm0
movq 0x410(%r14), %rax
movsd %xmm0, (%rax,%rbp,8)
movaps 0x8616a(%rip), %xmm0    # 0xcb400
movups %xmm0, 0x418(%r14)
movups %xmm0, 0x428(%r14)
movups %xmm0, 0x438(%r14)
incq %rbp
jmp 0x4525c
leaq 0x861cb(%rip), %rdi     # 0xcb485
jmp 0x452d0
movq %r15, %rdi
callq 0x218b0
pushq $0x1
popq %rbp
jmp 0x452dc
leaq 0x85c83(%rip), %rdi     # 0xcaf53
xorl %ebp, %ebp
movq %rbx, %rsi
xorl %eax, %eax
callq 0x82696
movl %ebp, %eax
addq $0x418, %rsp            # imm = 0x418
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/tomfunkhouser[P]gaps/pkgs/R3Shapes/R3MeshProperty.cpp
// Function: gaps::R3MeshProperty::ReadPoints(char const*)
int R3MeshProperty::
ReadPoints(const char *filename)
{
  // Open file
  FILE *fp = fopen(filename, "r");
  if (!fp) {
    RNFail("Unable to open ASCII file: %s\n", filename);
    return 0;
  }

  // Create property name
  SetName("Points");

  // Initialize all values to zero
  Clear(0);

  // Assign value 1 to vertices in pid file
  int vertex_index;
  while (fscanf(fp, "%d", &vertex_index) == (unsigned int) 1) {
    if ((vertex_index > 0) && (vertex_index < mesh->NVertices())) {
      SetVertexValue(vertex_index, 1);
    }
  }

  // Close file
  fclose(fp);

  // Return success
  return 1;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x10, %rsp
movq %rsi, %r15
movq %rdi, %rbx
leaq 0x8afe9(%rip), %rsi     # 0xd02f3
movq %r15, %rdi
callq 0x21a90
testq %rax, %rax
je 0x453ab
movq %rax, %r14
leaq 0x8617f(%rip), %rsi     # 0xcb4a4
movq %rbx, %rdi
callq 0x44480
xorps %xmm0, %xmm0
movq %rbx, %rdi
callq 0x43a8c
leaq 0x8ac2b(%rip), %r15     # 0xcff6a
leaq 0xc(%rsp), %r12
movabsq $0x3ff0000000000000, %r13 # imm = 0x3FF0000000000000
movq %r14, %rdi
movq %r15, %rsi
movq %r12, %rdx
xorl %eax, %eax
callq 0x22190
cmpl $0x1, %eax
jne 0x4539e
movslq 0xc(%rsp), %rax
testq %rax, %rax
jle 0x4534e
movq (%rbx), %rcx
cmpl 0x14(%rcx), %eax
jge 0x4534e
movq 0x410(%rbx), %rcx
movq %r13, (%rcx,%rax,8)
movaps 0x86079(%rip), %xmm0    # 0xcb400
movups %xmm0, 0x418(%rbx)
movups %xmm0, 0x428(%rbx)
movups %xmm0, 0x438(%rbx)
jmp 0x4534e
movq %r14, %rdi
callq 0x218b0
pushq $0x1
popq %rbx
jmp 0x453be
leaq 0x860d3(%rip), %rdi     # 0xcb485
xorl %ebx, %ebx
movq %r15, %rsi
xorl %eax, %eax
callq 0x82696
movl %ebx, %eax
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O2/tomfunkhouser[P]gaps/pkgs/R3Shapes/R3MeshProperty.cpp
// Function: gaps::R3MeshProperty::Write(char const*) const
int R3MeshProperty::
Write(const char *filename) const
{
  // Parse input filename extension
  const char *extension;
  if (!(extension = strrchr(filename, '.'))) {
    printf("Filename %s has no extension (e.g., .arff)\n", filename);
    return 0;
  }

  // Write file of appropriate type
  if (!strcmp(extension, ".arff")) return WriteARFF(filename);
  else if (!strcmp(extension, ".txt")) return WriteValues(filename);
  else if (!strcmp(extension, ".val")) return WriteValues(filename);
  else if (!strcmp(extension, ".dat")) return WriteValues(filename);

  // None of the extensions matched
  RNFail("Unable to write file %s (unrecognized extension: %s)\n", filename, extension);
  return 0;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rsi, %rbx
movq %rdi, %r14
pushq $0x2e
popq %rsi
movq %rbx, %rdi
callq 0x219b0
testq %rax, %rax
je 0x4544e
movq %rax, %r15
leaq 0x85ae8(%rip), %rsi     # 0xcaedb
movq %rax, %rdi
callq 0x21d10
testl %eax, %eax
je 0x45477
leaq 0x8426f(%rip), %rsi     # 0xc9675
movq %r15, %rdi
callq 0x21d10
testl %eax, %eax
je 0x45467
leaq 0x85e18(%rip), %rsi     # 0xcb231
movq %r15, %rdi
callq 0x21d10
testl %eax, %eax
je 0x45467
leaq 0x85e0a(%rip), %rsi     # 0xcb236
movq %r15, %rdi
callq 0x21d10
testl %eax, %eax
je 0x45467
leaq 0x8428b(%rip), %rdi     # 0xc96ca
movq %rbx, %rsi
movq %r15, %rdx
xorl %eax, %eax
callq 0x82696
jmp 0x4545f
leaq 0x85a5a(%rip), %rdi     # 0xcaeaf
movq %rbx, %rsi
xorl %eax, %eax
callq 0x21080
xorl %eax, %eax
popq %rbx
popq %r14
popq %r15
retq
movq %r14, %rdi
movq %rbx, %rsi
popq %rbx
popq %r14
popq %r15
jmp 0x45556
movq %r14, %rdi
movq %rbx, %rsi
popq %rbx
popq %r14
popq %r15
jmp 0x45488
nop
// File: /workspace/github_cpp_makefile_star2_O2/tomfunkhouser[P]gaps/pkgs/R3Shapes/R3MeshProperty.cpp
// Function: gaps::R3MeshProperty::WriteARFF(char const*) const
int R3MeshProperty::
WriteARFF(const char *filename) const
{
  // Open file
  FILE *fp = fopen(filename, "w");
  if (!fp) {
    RNFail("Unable to open ARFF file: %s\n", filename);
    return 0;
  }

  // Write header
  const char *mesh_name = (mesh->Name()) ? mesh->Name() : "Mesh";
  fprintf(fp, "@relation %s\n\n", mesh_name);

  // Write names
  const char *property_name = (Name()) ? Name() : "Property";
  fprintf(fp, "@attribute %s real\n", property_name);

  // Write values
  fprintf(fp, "\n@data\n\n");
  for (int i = 0; i < mesh->NVertices(); i++) {
    fprintf(fp, "%g\n", VertexValue(i));
  }

  // Close file
  fclose(fp);

  // Return success
  return 1;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %r15
movq %rdi, %rbx
leaq 0x87e8f(%rip), %rsi     # 0xcd32c
movq %r15, %rdi
callq 0x21a90
testq %rax, %rax
je 0x45535
movq %rax, %r14
movq (%rbx), %rdx
addq $0x78, %rdx
leaq 0x85d7c(%rip), %rsi     # 0xcb23b
xorl %r12d, %r12d
movq %rax, %rdi
xorl %eax, %eax
callq 0x21d80
leaq 0x8(%rbx), %rdx
leaq 0x85d73(%rip), %rsi     # 0xcb24a
movq %r14, %rdi
xorl %eax, %eax
callq 0x21d80
leaq 0x85d76(%rip), %rdi     # 0xcb25e
pushq $0x8
popq %rsi
pushq $0x1
popq %rdx
movq %r14, %rcx
callq 0x22290
leaq 0x853ec(%rip), %r15     # 0xca8e9
movq (%rbx), %rax
movslq 0x14(%rax), %rax
cmpq %rax, %r12
jge 0x45528
movq 0x410(%rbx), %rax
movsd (%rax,%r12,8), %xmm0
movq %r14, %rdi
movq %r15, %rsi
movb $0x1, %al
callq 0x21d80
incq %r12
jmp 0x454fd
movq %r14, %rdi
callq 0x218b0
pushq $0x1
popq %rbx
jmp 0x45548
leaq 0x859b4(%rip), %rdi     # 0xcaef0
xorl %ebx, %ebx
movq %r15, %rsi
xorl %eax, %eax
callq 0x82696
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O2/tomfunkhouser[P]gaps/pkgs/R3Shapes/R3MeshProperty.cpp
// Function: gaps::R3MeshProperty::WriteValues(char const*) const
int R3MeshProperty::
WriteValues(const char *filename) const
{
  // Open file
  FILE *fp = fopen(filename, "w");
  if (!fp) {
    RNFail("Unable to open values file: %s\n", filename);
    return 0;
  }

  // Write values
  for (int i = 0; i < mesh->NVertices(); i++) {
    fprintf(fp, "%g\n", values[i]);
  }

  // Close file
  fclose(fp);

  // Return success
  return 1;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %r15
movq %rdi, %rbx
leaq 0x87dc1(%rip), %rsi     # 0xcd32c
movq %r15, %rdi
callq 0x21a90
testq %rax, %rax
je 0x455bd
movq %rax, %r14
xorl %r12d, %r12d
leaq 0x85364(%rip), %r15     # 0xca8e9
movq (%rbx), %rax
movslq 0x14(%rax), %rax
cmpq %rax, %r12
jge 0x455b0
movq 0x410(%rbx), %rax
movsd (%rax,%r12,8), %xmm0
movq %r14, %rdi
movq %r15, %rsi
movb $0x1, %al
callq 0x21d80
incq %r12
jmp 0x45585
movq %r14, %rdi
callq 0x218b0
pushq $0x1
popq %rbx
jmp 0x455d0
leaq 0x85e0e(%rip), %rdi     # 0xcb3d2
xorl %ebx, %ebx
movq %r15, %rsi
xorl %eax, %eax
callq 0x82696
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O2/biotomas[P]ipasir/app/genipasat/genipasat.c
// Function: die
static void die (const char * fmt, ...) {
  va_list ap;
  fflush (stderr);
  printf ("*** genipasat: ");
  va_start (ap, fmt);
  vprintf (fmt, ap);
  va_end (ap);
  fputc ('\n', stdout);
  fflush (stdout);
  exit (1);
}

// Assembly:
pushq %r14
pushq %rbx
subq $0xd8, %rsp
movq %rdi, %rbx
leaq 0x20(%rsp), %r14
movq %rsi, 0x8(%r14)
movq %rdx, 0x10(%r14)
movq %rcx, 0x18(%r14)
movq %r8, 0x20(%r14)
movq %r9, 0x28(%r14)
testb %al, %al
je 0x18ae
movaps %xmm0, 0x50(%rsp)
movaps %xmm1, 0x60(%rsp)
movaps %xmm2, 0x70(%rsp)
movaps %xmm3, 0x80(%rsp)
movaps %xmm4, 0x90(%rsp)
movaps %xmm5, 0xa0(%rsp)
movaps %xmm6, 0xb0(%rsp)
movaps %xmm7, 0xc0(%rsp)
movq 0x14743(%rip), %rax     # 0x15ff8
movq (%rax), %rdi
callq 0x1160
leaq 0xd9d3(%rip), %rdi      # 0xf297
xorl %eax, %eax
callq 0x10c0
movabsq $0x3000000008, %rax     # imm = 0x3000000008
movq %rsp, %rsi
movq %rax, (%rsi)
leaq 0xf0(%rsp), %rax
movq %rax, 0x8(%rsi)
movq %r14, 0x10(%rsi)
movq %rbx, %rdi
callq 0x1170
movq 0x146d6(%rip), %rbx     # 0x15fd0
movq (%rbx), %rsi
pushq $0xa
popq %rdi
callq 0x1110
movq (%rbx), %rdi
callq 0x1160
pushq $0x1
popq %rdi
callq 0x11e0
// File: /workspace/github_cpp_makefile_star2_O2/biotomas[P]ipasir/app/genipasat/genipasat.c
// Function: msg
static void msg (const char * fmt, ...) {
  va_list ap;
  fflush (stderr);
  printf ("c [genipasat] ");
  va_start (ap, fmt);
  vprintf (fmt, ap);
  va_end (ap);
  fputc ('\n', stdout);
  fflush (stdout);
}

// Assembly:
pushq %r14
pushq %rbx
subq $0xd8, %rsp
movq %rdi, %rbx
leaq 0x20(%rsp), %r14
movq %rsi, 0x8(%r14)
movq %rdx, 0x10(%r14)
movq %rcx, 0x18(%r14)
movq %r8, 0x20(%r14)
movq %r9, 0x28(%r14)
testb %al, %al
je 0x1976
movaps %xmm0, 0x50(%rsp)
movaps %xmm1, 0x60(%rsp)
movaps %xmm2, 0x70(%rsp)
movaps %xmm3, 0x80(%rsp)
movaps %xmm4, 0x90(%rsp)
movaps %xmm5, 0xa0(%rsp)
movaps %xmm6, 0xb0(%rsp)
movaps %xmm7, 0xc0(%rsp)
movq 0x1467b(%rip), %rax     # 0x15ff8
movq (%rax), %rdi
callq 0x1160
leaq 0xd91b(%rip), %rdi      # 0xf2a7
xorl %eax, %eax
callq 0x10c0
movabsq $0x3000000008, %rax     # imm = 0x3000000008
movq %rsp, %rsi
movq %rax, (%rsi)
leaq 0xf0(%rsp), %rax
movq %rax, 0x8(%rsi)
movq %r14, 0x10(%rsi)
movq %rbx, %rdi
callq 0x1170
movq 0x1460e(%rip), %rbx     # 0x15fd0
movq (%rbx), %rsi
pushq $0xa
popq %rdi
callq 0x1110
movq (%rbx), %rdi
callq 0x1160
addq $0xd8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_cpp_makefile_star2_O2/biotomas[P]ipasir/app/genipasat/genipasat.c
// Function: pipeit
static FILE * pipeit (const char * name, const char * fmt) {
  char * cmd = malloc (strlen (name) + strlen (fmt) + 20);
  FILE * res;
  sprintf (cmd, fmt, name);
  res = popen (cmd, "r");
  free (cmd);
  return res;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rsi, %rbx
movq %rdi, %r14
callq 0x10b0
movq %rax, %r15
movq %rbx, %rdi
callq 0x10b0
leaq (%r15,%rax), %rdi
addq $0x14, %rdi
callq 0x1150
movq %rax, %r15
movq %rax, %rdi
movq %rbx, %rsi
movq %r14, %rdx
xorl %eax, %eax
callq 0x11d0
leaq 0x101ac(%rip), %rsi     # 0x11c13
movq %r15, %rdi
callq 0x1190
movq %rax, %rbx
movq %r15, %rdi
callq 0x1040
movq %rbx, %rax
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O2/biotomas[P]ipasir/app/genipasat/genipasat.c
// Function: perr
static void perr (const char * fmt, ...) {
  va_list ap;
  fflush (stderr);
  printf ("*** genipasat: parse error in '%s' line '%d': ", name, lineno);
  va_start (ap, fmt);
  vprintf (fmt, ap);
  va_end (ap);
  fputc ('\n', stdout);
  fflush (stdout);
  exit (1);
}

// Assembly:
pushq %r14
pushq %rbx
subq $0xd8, %rsp
movq %rdi, %rbx
leaq 0x20(%rsp), %r14
movq %rsi, 0x8(%r14)
movq %rdx, 0x10(%r14)
movq %rcx, 0x18(%r14)
movq %r8, 0x20(%r14)
movq %r9, 0x28(%r14)
testb %al, %al
je 0x1af7
movaps %xmm0, 0x50(%rsp)
movaps %xmm1, 0x60(%rsp)
movaps %xmm2, 0x70(%rsp)
movaps %xmm3, 0x80(%rsp)
movaps %xmm4, 0x90(%rsp)
movaps %xmm5, 0xa0(%rsp)
movaps %xmm6, 0xb0(%rsp)
movaps %xmm7, 0xc0(%rsp)
movq 0x144fa(%rip), %rax     # 0x15ff8
movq (%rax), %rdi
callq 0x1160
movq 0x14623(%rip), %rsi     # 0x16130
movl 0x1460d(%rip), %edx     # 0x16120
leaq 0xd79c(%rip), %rdi      # 0xf2b6
xorl %eax, %eax
callq 0x10c0
movabsq $0x3000000008, %rax     # imm = 0x3000000008
movq %rsp, %rsi
movq %rax, (%rsi)
leaq 0xf0(%rsp), %rax
movq %rax, 0x8(%rsi)
movq %r14, 0x10(%rsi)
movq %rbx, %rdi
callq 0x1170
movq 0x14480(%rip), %rbx     # 0x15fd0
movq (%rbx), %rsi
pushq $0xa
popq %rdi
callq 0x1110
movq (%rbx), %rdi
callq 0x1160
pushq $0x1
popq %rdi
callq 0x11e0
// File: /workspace/github_cpp_makefile_star2_O2/biotomas[P]ipasir/app/genipasat/genipasat.c
// Function: getime
static double getime (void) {
  struct rusage u;
  double res;
  if (getrusage (RUSAGE_SELF, &u)) return 0;
  res = u.ru_utime.tv_sec + 1e-6 * u.ru_utime.tv_usec;
  res += u.ru_stime.tv_sec + 1e-6 * u.ru_stime.tv_usec;
  return res;
}

// Assembly:
subq $0x98, %rsp
leaq 0x8(%rsp), %rsi
xorl %edi, %edi
callq 0x11b0
xorpd %xmm0, %xmm0
testl %eax, %eax
jne 0x1bbe
cvtsi2sdq 0x8(%rsp), %xmm1
cvtsi2sdq 0x10(%rsp), %xmm2
movsd 0xd46c(%rip), %xmm3     # 0xf008
mulsd %xmm3, %xmm2
cvtsi2sdq 0x18(%rsp), %xmm4
cvtsi2sdq 0x20(%rsp), %xmm0
addsd %xmm1, %xmm2
mulsd %xmm3, %xmm0
addsd %xmm4, %xmm0
addsd %xmm2, %xmm0
addq $0x98, %rsp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/xuchanglong[P]SimpleReactorImplemention-comments/reactor_server_test.cc
// Function: main
int main(int argc, char **argv)
{
    if (argc < 3) {
        fprintf(stderr, "usage: %s ip port\n", argv[0]);
        return EXIT_FAILURE;
    }

    /**
     * 命令行参数，第1个是 IP ，第2个是 port 。
     * （1）启动服务器。
    */
    TimeServer server(argv[1], atoi(argv[2]));
    if (!server.Start()) {
        fprintf(stderr, "start server failed\n");
        return EXIT_FAILURE;
    }
    fprintf(stderr, "server started!\n");

    heap_timer *printtask = new heap_timer(5);
    printtask->cb_func = printHelloworld;

    fprintf(stderr, "register a task which will be run is five seconds!\n");
    g_reactor.RegisterTimerTask(printtask);

    /**
     * （3）向 Reactor 中注册事件处理器：server 。
    */
    g_reactor.RegisterHandler(&server, reactor::kReadEvent);

    while (true) {
        /**
         * （4）监控并分发事件到各个事件处理器。
        */
        g_reactor.HandleEvents();
    }
    return EXIT_SUCCESS;
}

// Assembly:
pushq %r14
pushq %rbx
subq $0x38, %rsp
cmpl $0x2, %edi
jg 0x2545
movq 0x4aac(%rip), %rax      # 0x6fd8
movq (%rax), %rdi
movq (%rsi), %rdx
leaq 0x1b02(%rip), %rsi      # 0x403b
xorl %eax, %eax
callq 0x2280
jmp 0x260d
movq 0x8(%rsi), %rbx
movq 0x10(%rsi), %rdi
callq 0x22b0
movzwl %ax, %edx
movq %rsp, %r14
movq %r14, %rdi
movq %rbx, %rsi
callq 0x2630
movq %r14, %rdi
callq 0x265e
movq 0x4a66(%rip), %r14      # 0x6fd8
movq (%r14), %rcx
testb %al, %al
je 0x25f3
leaq 0x1ae3(%rip), %rdi      # 0x4063
pushq $0x10
popq %rsi
pushq $0x1
popq %rdx
callq 0x2300
pushq $0x18
popq %rdi
callq 0x21f0
movq %rax, %rbx
pushq $0x5
popq %rsi
movq %rax, %rdi
callq 0x26ee
leaq -0xab(%rip), %rax       # 0x24fd
movq %rax, 0x8(%rbx)
movq (%r14), %rcx
leaq 0x1abe(%rip), %rdi      # 0x4074
pushq $0x33
popq %rsi
pushq $0x1
popq %rdx
callq 0x2300
callq 0x2710
movq (%rax), %rdi
movq %rbx, %rsi
callq 0x345e
callq 0x2710
movq (%rax), %rdi
movq %rsp, %rsi
pushq $0x1
popq %rdx
callq 0x334e
callq 0x2710
movq (%rax), %rdi
callq 0x340a
jmp 0x25e4
leaq 0x1a54(%rip), %rdi      # 0x404e
pushq $0x14
popq %rsi
pushq $0x1
popq %rdx
callq 0x2300
movq %rsp, %rdi
callq 0x275a
pushq $0x1
popq %rax
addq $0x38, %rsp
popq %rbx
popq %r14
retq
jmp 0x261c
jmp 0x261c
movq %rax, %rbx
movq %rsp, %rdi
callq 0x275a
movq %rbx, %rdi
callq 0x22d0
nop
// File: /workspace/github_cpp_makefile_star2_O2/xuchanglong[P]SimpleReactorImplemention-comments/./eventhandler/timeserver.hpp
// Function: TimeServer::Start()
bool Start()
    {
        m_handle = socket(AF_INET, SOCK_STREAM, 0);
        if (!IsValidHandle(m_handle)) {
            ReportSocketError("socket");
            return false;
        }

        struct sockaddr_in addr;
        addr.sin_family = AF_INET;
        addr.sin_port = htons(m_port);
        addr.sin_addr.s_addr = inet_addr(m_ip.c_str());
        if (bind(m_handle, (struct sockaddr *)&addr, sizeof(addr)) < 0) {
            ReportSocketError("bind");
            return false;
        }

        if (listen(m_handle, 10) < 0) {
            ReportSocketError("listen");
            return false;
        }
        return true;
    }

// Assembly:
pushq %r14
pushq %rbx
subq $0x18, %rsp
movq %rdi, %rbx
pushq $0x2
popq %rdi
pushq $0x1
popq %rsi
xorl %edx, %edx
callq 0x2080
movl %eax, 0x8(%rbx)
testl %eax, %eax
js 0x26cf
leaq 0x8(%rsp), %r14
movw $0x2, (%r14)
movzwl 0x30(%rbx), %eax
rolw $0x8, %ax
movw %ax, 0x2(%r14)
movq 0x10(%rbx), %rdi
callq 0x2200
movl %eax, 0x4(%r14)
movl 0x8(%rbx), %edi
pushq $0x10
popq %rdx
movq %r14, %rsi
callq 0x2050
testl %eax, %eax
js 0x26d8
movl 0x8(%rbx), %edi
pushq $0xa
popq %rsi
callq 0x2230
movl %eax, %ecx
movb $0x1, %al
testl %ecx, %ecx
jns 0x26e6
leaq 0x1ab7(%rip), %rdi      # 0x4184
jmp 0x26df
leaq 0x1aa2(%rip), %rdi      # 0x4178
jmp 0x26df
leaq 0x1aa0(%rip), %rdi      # 0x417f
callq 0x24c2
xorl %eax, %eax
addq $0x18, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_cpp_makefile_star2_O2/xuchanglong[P]SimpleReactorImplemention-comments/./eventhandler/timeserver.hpp
// Function: TimeServer::HandleRead()
virtual void HandleRead()
    {
        struct sockaddr addr;
        socklen_t addrlen = sizeof(addr);
        reactor::handle_t handle = accept(m_handle, &addr, &addrlen);
        if (!IsValidHandle(handle)) {
            ReportSocketError("accept");
        } else {
            /**
             * 对该新连接注册读写事件。
            */
            RequestHandler *handler = new RequestHandler(handle);
            if (g_reactor.RegisterHandler(handler, reactor::kReadEvent) != 0) {
                fprintf(stderr, "error: register handler failed\n");
                delete handler;
            }
        }
    }

// Assembly:
pushq %rbp
pushq %rbx
subq $0x18, %rsp
leaq 0x4(%rsp), %rdx
movl $0x10, (%rdx)
movl 0x8(%rdi), %edi
leaq 0x8(%rsp), %rsi
callq 0x20a0
testl %eax, %eax
js 0x283e
movl %eax, %ebp
pushq $0x10
popq %rdi
callq 0x21f0
movq %rax, %rbx
leaq 0x4516(%rip), %rax      # 0x6d10
movq %rax, (%rbx)
movl %ebp, 0x8(%rbx)
callq 0x2710
movq (%rax), %rdi
pushq $0x1
popq %rdx
movq %rbx, %rsi
callq 0x334e
testl %eax, %eax
je 0x284a
movq 0x47ba(%rip), %rax      # 0x6fd8
movq (%rax), %rcx
leaq 0x18b1(%rip), %rdi      # 0x40d9
pushq $0x1f
popq %rsi
pushq $0x1
popq %rdx
callq 0x2300
movq (%rbx), %rax
movq %rbx, %rdi
callq *0x8(%rax)
jmp 0x284a
leaq 0x188d(%rip), %rdi      # 0x40d2
callq 0x24c2
addq $0x18, %rsp
popq %rbx
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/xuchanglong[P]SimpleReactorImplemention-comments/./eventhandler/timeserver.hpp
// Function: RequestHandler::HandleRead()
virtual void HandleRead()
    {
        memset(g_read_buffer, 0, sizeof(g_read_buffer));
        int len = recv(m_handle, g_read_buffer, BUFFERSIZE, 0);
        if (len > 0) {
            if (strncasecmp("time", g_read_buffer, 4) == 0) {
                g_reactor.RegisterHandler(this, reactor::kWriteEvent);
            } else if (strncasecmp("exit", g_read_buffer, 4) == 0) {
                close(m_handle);
                g_reactor.RemoveHandler(this);
                delete this;
            } else {
                fprintf(stderr, "Invalid request: %s", g_read_buffer);
                close(m_handle);
                g_reactor.RemoveHandler(this);
                delete this;
            }
        } else {
            ReportSocketError("recv");
        }
    }

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
leaq 0x48c8(%rip), %r14      # 0x71d0
movl $0x400, %edx            # imm = 0x400
movq %r14, %rdi
xorl %esi, %esi
callq 0x2140
movl 0x8(%rbx), %edi
movl $0x400, %edx            # imm = 0x400
movq %r14, %rsi
xorl %ecx, %ecx
callq 0x20b0
testl %eax, %eax
jle 0x2989
leaq 0x17c5(%rip), %rdi      # 0x40f9
leaq 0x4895(%rip), %rsi      # 0x71d0
pushq $0x4
popq %rdx
callq 0x2250
testl %eax, %eax
je 0x299c
leaq 0x17b0(%rip), %rdi      # 0x40fe
leaq 0x487b(%rip), %rsi      # 0x71d0
pushq $0x4
popq %rdx
callq 0x2250
testl %eax, %eax
jne 0x29b6
movl 0x8(%rbx), %edi
callq 0x2310
callq 0x2710
movq (%rax), %rdi
movq %rbx, %rsi
callq 0x33c0
movq (%rbx), %rax
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
jmpq *0x8(%rax)
leaq 0x1787(%rip), %rdi      # 0x4117
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x24c2
callq 0x2710
movq (%rax), %rdi
pushq $0x2
popq %rdx
movq %rbx, %rsi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x334e
movq 0x461b(%rip), %rax      # 0x6fd8
movq (%rax), %rdi
leaq 0x173c(%rip), %rsi      # 0x4103
leaq 0x4802(%rip), %rdx      # 0x71d0
xorl %eax, %eax
callq 0x2280
jmp 0x2961
nop
// File: /workspace/github_cpp_makefile_star2_O2/xuchanglong[P]SimpleReactorImplemention-comments/./eventhandler/timeserver.hpp
// Function: RequestHandler::HandleWrite()
virtual void HandleWrite()
    {
        struct tm *ttime;
        char now[64];
        time_t tt;

        memset(now, 0, 64);
        tt = time(nullptr);
        ttime = localtime(&tt);
        strftime(now, 64, "%Y-%m-%d %H:%M:%S", ttime);

        memset(g_write_buffer, 0, sizeof(g_write_buffer));
        int len = sprintf(g_write_buffer, "current time: %s\r\n", now);
        len = send(m_handle, g_write_buffer, len, 0);
        if (len > 0) {
            fprintf(stderr, "send response to client, fd=%d\n", (int)m_handle);
            g_reactor.RegisterHandler(this, reactor::kReadEvent);
        } else {
            ReportSocketError("send");
        }
    }

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x50, %rsp
movq %rdi, %rbx
xorps %xmm0, %xmm0
leaq 0x10(%rsp), %r14
movaps %xmm0, (%r14)
movaps %xmm0, 0x10(%r14)
movaps %xmm0, 0x20(%r14)
movaps %xmm0, 0x30(%r14)
xorl %edi, %edi
callq 0x21e0
leaq 0x8(%rsp), %rdi
movq %rax, (%rdi)
callq 0x2190
leaq 0x1702(%rip), %rdx      # 0x411c
pushq $0x40
popq %rsi
movq %r14, %rdi
movq %rax, %rcx
callq 0x21b0
leaq 0x4ba1(%rip), %r15      # 0x75d0
movl $0x400, %edx            # imm = 0x400
movq %r15, %rdi
xorl %esi, %esi
callq 0x2140
leaq 0x16e9(%rip), %rsi      # 0x412e
movq %r15, %rdi
movq %r14, %rdx
xorl %eax, %eax
callq 0x2070
movl 0x8(%rbx), %edi
movslq %eax, %rdx
movq %r15, %rsi
xorl %ecx, %ecx
callq 0x2120
testl %eax, %eax
jg 0x2a7c
leaq 0x16f4(%rip), %rdi      # 0x4161
callq 0x24c2
addq $0x50, %rsp
popq %rbx
popq %r14
popq %r15
retq
movq 0x4555(%rip), %rax      # 0x6fd8
movq (%rax), %rdi
movl 0x8(%rbx), %edx
leaq 0x16b1(%rip), %rsi      # 0x4141
xorl %eax, %eax
callq 0x2280
callq 0x2710
movq (%rax), %rdi
pushq $0x1
popq %rdx
movq %rbx, %rsi
callq 0x334e
jmp 0x2a72
// File: /workspace/github_cpp_makefile_star2_O2/xuchanglong[P]SimpleReactorImplemention-comments/./eventhandler/timeserver.hpp
// Function: RequestHandler::HandleError()
virtual void HandleError()
    {
        fprintf(stderr, "client %d closed\n", m_handle);
        close(m_handle);
        g_reactor.RemoveHandler(this);
        delete this;
    }

// Assembly:
pushq %rbx
movq %rdi, %rbx
movq 0x4521(%rip), %rax      # 0x6fd8
movq (%rax), %rdi
movl 0x8(%rbx), %edx
leaq 0x16a2(%rip), %rsi      # 0x4166
xorl %eax, %eax
callq 0x2280
movl 0x8(%rbx), %edi
callq 0x2310
callq 0x2710
movq (%rax), %rdi
movq %rbx, %rsi
callq 0x33c0
movq (%rbx), %rax
movq %rbx, %rdi
popq %rbx
jmpq *0x8(%rax)
nopl (%rax)