LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/R3Shapes/ply.cpp
// Function: ply_write
PlyFile *ply_write(
  FILE *fp,
  int nelems,
  char **elem_names,
  int file_type
)
{
  int i;
  PlyFile *plyfile;
  PlyElement *elem;

  /* check for NULL file pointer */
  if (fp == NULL)
    return (NULL);

  if (native_binary_type == -1)
     get_native_binary_type();
  if (!types_checked)
     check_types();
  
  /* create a record for this object */

  plyfile = (PlyFile *) myalloc (sizeof (PlyFile));
  if (file_type == PLY_BINARY_NATIVE)
     plyfile->file_type = native_binary_type;
  else
     plyfile->file_type = file_type;
  plyfile->num_comments = 0;
  plyfile->num_obj_info = 0;
  plyfile->nelems = nelems;
  plyfile->version = 1.0;
  plyfile->fp = fp;
  plyfile->other_elems = NULL;

  /* tuck aside the names of the elements */

  plyfile->elems = (PlyElement **) myalloc (sizeof (PlyElement *) * nelems);
  for (i = 0; i < nelems; i++) {
    elem = (PlyElement *) myalloc (sizeof (PlyElement));
    plyfile->elems[i] = elem;
    elem->name = my_strdup (elem_names[i]);
    elem->num = 0;
    elem->nprops = 0;
  }

  /* return pointer to the file descriptor */
  return (plyfile);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
testq %rdi, %rdi
je 0x3e3e9
movl %ecx, %ebp
movq %rdx, %rbx
movl %esi, %r15d
movq %rdi, %r12
cmpb $0x0, 0x4a8856(%rip)    # 0x4e6b68
jne 0x3e31b
movb $0x1, 0x4a884d(%rip)    # 0x4e6b68
cmpb $0x0, 0x4a884a(%rip)    # 0x4e6b6c
jne 0x3e329
callq 0x3e406
leaq 0x6a5bb(%rip), %r13     # 0xa88eb
movl $0x50, %edi
movl $0xad, %esi
movq %r13, %rdx
callq 0x3e440
movq %rax, %r14
movzbl 0x4a881c(%rip), %eax    # 0x4e6b68
decl %eax
orl $0x3, %eax
cmpl $0x4, %ebp
cmovnel %ebp, %eax
movl %eax, 0x8(%r14)
xorl %ebp, %ebp
movl %ebp, 0x20(%r14)
movl %ebp, 0x30(%r14)
movl %r15d, 0x10(%r14)
movl $0x3f800000, 0xc(%r14)  # imm = 0x3F800000
movq %r12, (%r14)
movq $0x0, 0x48(%r14)
leal (,%r15,8), %edi
movl $0xbb, %esi
movq %r13, %rdx
callq 0x3e440
movq %rax, 0x18(%r14)
testl %r15d, %r15d
jle 0x3e3ec
movq %rax, %r12
movq %r14, (%rsp)
movl %r15d, %r14d
movq %rbx, %r15
xorl %ebx, %ebx
movl $0x30, %edi
movl $0xbd, %esi
leaq 0x6a531(%rip), %rdx     # 0xa88eb
callq 0x3e440
movq %rax, %r13
movq %rax, (%r12,%rbx,8)
movq (%r15,%rbx,8), %rdi
callq 0x3e480
movq %rax, (%r13)
movl %ebp, 0x8(%r13)
movl %ebp, 0x10(%r13)
incq %rbx
cmpq %rbx, %r14
jne 0x3e3a9
movq (%rsp), %r14
jmp 0x3e3ec
xorl %r14d, %r14d
movq %r14, %rax
addq $0x8, %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/ply.cpp
// Function: my_alloc(int, int, char*)
char *my_alloc(int size, int lnum, char *fname)
{
  char *ptr;

  ptr = (char *) malloc (size);

  if (ptr == 0) {
    fprintf(stderr, "Memory allocation bombed on line %d in %s\n", lnum, fname);
  }

  return (ptr);
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movq %rdx, %rbx
movl %esi, %ebp
movslq %edi, %rdi
callq 0xe5e0
movq %rax, %r14
testq %rax, %rax
je 0x3e461
movq %r14, %rax
popq %rbx
popq %r14
popq %rbp
retq
movq 0xa6b50(%rip), %rax     # 0xe4fb8
movq (%rax), %rdi
leaq 0x6a9f0(%rip), %rsi     # 0xa8e62
movl %ebp, %edx
movq %rbx, %rcx
xorl %eax, %eax
callq 0xe670
jmp 0x3e459
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/R3Shapes/ply.cpp
// Function: my_strdup(char*)
char *my_strdup(char *str)
{
  // Copy a string (strdup is not part of standard)
  size_t len = strlen(str) + 1;
  void *output = malloc(len);
  if (output == NULL) return NULL;
  return (char *) memcpy (output, str, len);
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
callq 0xe1e0
movq %rax, %r14
incq %r14
movq %r14, %rdi
callq 0xe5e0
testq %rax, %rax
je 0x3e4b4
movq %rax, %rdi
movq %rbx, %rsi
movq %r14, %rdx
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0xe370
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/R3Shapes/ply.cpp
// Function: ply_open_for_writing
PlyFile *ply_open_for_writing(
  char *filename,
  int nelems,
  char **elem_names,
  int file_type,
  float *version
)
{
  PlyFile *plyfile;
  char *name;
  FILE *fp;

  /* tack on the extension .ply, if necessary */

  name = (char *) myalloc (sizeof (char) * (strlen (filename) + 5));
  strcpy (name, filename);
  if (strlen (name) < 4 ||
      strcmp (name + strlen (name) - 4, ".ply") != 0)
      strcat (name, ".ply");

  /* open the file for writing */

  fp = fopen (name, "w");
  if (fp == NULL) {
    return (NULL);
  }

  /* create the actual PlyFile structure */

  plyfile = ply_write (fp, nelems, elem_names, file_type);
  if (plyfile == NULL)
    return (NULL);

  /* say what PLY file version number we're writing */
  *version = plyfile->version;

  /* return pointer to the file descriptor */
  return (plyfile);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %r8, %rbx
movl %ecx, %ebp
movq %rdx, %r14
movl %esi, %r15d
movq %rdi, %r13
callq 0xe1e0
leal 0x5(%rax), %edi
leaq 0x6a405(%rip), %rdx     # 0xa88eb
movl $0xe5, %esi
callq 0x3e440
movq %rax, %r12
movq %rax, %rdi
movq %r13, %rsi
callq 0xe3d0
movq %r12, %rdi
callq 0xe1e0
cmpq $0x4, %rax
jb 0x3e524
leaq (%r12,%rax), %rdi
addq $-0x4, %rdi
leaq 0x63e51(%rip), %rsi     # 0xa236c
callq 0xe640
testl %eax, %eax
je 0x3e53a
movq %r12, %rdi
callq 0xe1e0
movl $0x796c702e, (%r12,%rax) # imm = 0x796C702E
movb $0x0, 0x4(%r12,%rax)
leaq 0x6927c(%rip), %rsi     # 0xa77bd
movq %r12, %rdi
callq 0xe530
testq %rax, %rax
je 0x3e56e
movq %rax, %rdi
movl %r15d, %esi
movq %r14, %rdx
movl %ebp, %ecx
callq 0x3e2ec
testq %rax, %rax
je 0x3e56e
movss 0xc(%rax), %xmm0
movss %xmm0, (%rbx)
jmp 0x3e570
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/R3Shapes/ply.cpp
// Function: ply_describe_element
void ply_describe_element(
  PlyFile *plyfile,
  char *elem_name,
  int nelems,
  int nprops,
  PlyProperty *prop_list
)
{
  int i;
  PlyElement *elem;
  PlyProperty *prop;

  /* look for appropriate element */
  elem = find_element (plyfile, elem_name);
  if (elem == NULL) {
    fprintf(stderr,"ply_describe_element: can't find element '%s'\n",elem_name);
    exit (-1);
  }

  elem->num = nelems;

  /* copy the list of properties */

  elem->nprops = nprops;
  elem->props = (PlyProperty **) myalloc (sizeof (PlyProperty *) * nprops);
  elem->store_prop = (char *) myalloc (sizeof (char) * nprops);

  for (i = 0; i < nprops; i++) {
    prop = (PlyProperty *) myalloc (sizeof (PlyProperty));
    elem->props[i] = prop;
    elem->store_prop[i] = NAMED_PROP;
    copy_property (prop, &prop_list[i]);
  }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %r8, %rbx
movl %ecx, %r15d
movl %edx, %ebp
movq %rsi, %r12
callq 0x3e644
testq %rax, %rax
je 0x3e63c
movq %rax, %r14
movl %ebp, 0x8(%rax)
movl %r15d, 0x10(%rax)
leal (,%r15,8), %edi
leaq 0x6a32f(%rip), %r12     # 0xa88eb
movl $0x124, %esi            # imm = 0x124
movq %r12, %rdx
callq 0x3e440
movq %rax, 0x18(%r14)
movl %r15d, %edi
movl $0x125, %esi            # imm = 0x125
movq %r12, %rdx
callq 0x3e440
movq %rax, 0x20(%r14)
testl %r15d, %r15d
jle 0x3e62d
movl %r15d, %r12d
xorl %r13d, %r13d
leaq 0x6a2f8(%rip), %r15     # 0xa88eb
movl $0x28, %edi
movl $0x128, %esi            # imm = 0x128
movq %r15, %rdx
callq 0x3e440
movq 0x18(%r14), %rcx
movq %rax, (%rcx,%r13,8)
movq 0x20(%r14), %rcx
movb $0x1, (%rcx,%r13)
movq %rax, %rdi
movq %rbx, %rsi
callq 0x3e68a
incq %r13
addq $0x28, %rbx
cmpq %r13, %r12
jne 0x3e5f3
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %r12, %rdi
callq 0xeae3
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/R3Shapes/ply.cpp
// Function: find_element(PlyFile*, char*)
PlyElement *find_element(PlyFile *plyfile, char *element)
{
  int i;

  for (i = 0; i < plyfile->nelems; i++)
    if (equal_strings (element, plyfile->elems[i]->name))
      return (plyfile->elems[i]);

  return (NULL);
}

// Assembly:
movslq 0x10(%rdi), %rcx
testq %rcx, %rcx
jle 0x3e687
movq 0x18(%rdi), %rdx
xorl %edi, %edi
movq (%rdx,%rdi,8), %rax
movq (%rax), %r8
xorl %r9d, %r9d
movb (%rsi,%r9), %r10b
testb %r10b, %r10b
je 0x3e679
movb (%r8,%r9), %r11b
testb %r11b, %r11b
je 0x3e679
incq %r9
cmpb %r11b, %r10b
je 0x3e65d
jmp 0x3e67f
cmpb (%r8,%r9), %r10b
je 0x3e689
incq %rdi
cmpq %rcx, %rdi
jne 0x3e653
xorl %eax, %eax
retq
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/R3Shapes/ply.cpp
// Function: copy_property(PlyProperty*, PlyProperty*)
void copy_property(PlyProperty *dest, PlyProperty *src)
{
  dest->name = my_strdup (src->name);
  dest->external_type = src->external_type;
  dest->internal_type = src->internal_type;
  dest->offset = src->offset;

  dest->is_list = src->is_list;
  dest->count_external = src->count_external;
  dest->count_internal = src->count_internal;
  dest->count_offset = src->count_offset;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
movq (%rsi), %rdi
callq 0x3e480
movq %rax, (%r14)
movups 0x8(%rbx), %xmm0
movups %xmm0, 0x8(%r14)
movq 0x18(%rbx), %rax
movq %rax, 0x18(%r14)
movl 0x20(%rbx), %eax
movl %eax, 0x20(%r14)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/R3Shapes/ply.cpp
// Function: ply_describe_property
void ply_describe_property(
  PlyFile *plyfile,
  char *elem_name,
  PlyProperty *prop
)
{
  PlyElement *elem;
  PlyProperty *elem_prop;

  /* look for appropriate element */
  elem = find_element (plyfile, elem_name);
  if (elem == NULL) {
    fprintf(stderr, "ply_describe_property: can't find element '%s'\n",
            elem_name);
    return;
  }

  /* create room for new property */

  if (elem->nprops == 0) {
    elem->props = (PlyProperty **) myalloc (sizeof (PlyProperty *));
    elem->store_prop = (char *) myalloc (sizeof (char));
    elem->nprops = 1;
  }
  else {
    elem->nprops++;
    elem->props = (PlyProperty **)
                  realloc (elem->props, sizeof (PlyProperty *) * elem->nprops);
    elem->store_prop = (char *)
                  realloc (elem->store_prop, sizeof (char) * elem->nprops);
  }

  /* copy the new property */

  elem_prop = (PlyProperty *) myalloc (sizeof (PlyProperty));
  elem->props[elem->nprops - 1] = elem_prop;
  elem->store_prop[elem->nprops - 1] = NAMED_PROP;
  copy_property (elem_prop, prop);
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdx, %rbx
movq %rsi, %r15
callq 0x3e644
testq %rax, %rax
je 0x3e78b
movq %rax, %r14
movslq 0x10(%rax), %rax
testq %rax, %rax
je 0x3e714
leaq 0x1(%rax), %rcx
movl %ecx, 0x10(%r14)
movq 0x18(%r14), %rdi
leaq 0x8(,%rax,8), %rsi
callq 0xe7a0
movq %rax, 0x18(%r14)
movq 0x20(%r14), %rdi
movslq 0x10(%r14), %rsi
callq 0xe7a0
movq %rax, 0x20(%r14)
jmp 0x3e74f
leaq 0x6a1d0(%rip), %r15     # 0xa88eb
movl $0x8, %edi
movl $0x14d, %esi            # imm = 0x14D
movq %r15, %rdx
callq 0x3e440
movq %rax, 0x18(%r14)
movl $0x1, %edi
movl $0x14e, %esi            # imm = 0x14E
movq %r15, %rdx
callq 0x3e440
movq %rax, 0x20(%r14)
movl $0x1, 0x10(%r14)
leaq 0x6a195(%rip), %rdx     # 0xa88eb
movl $0x28, %edi
movl $0x15b, %esi            # imm = 0x15B
callq 0x3e440
movq 0x18(%r14), %rcx
movslq 0x10(%r14), %rdx
movq %rax, -0x8(%rcx,%rdx,8)
movq 0x20(%r14), %rcx
movb $0x1, -0x1(%rcx,%rdx)
movq %rax, %rdi
movq %rbx, %rsi
popq %rbx
popq %r14
popq %r15
jmp 0x3e68a
movq 0xa6826(%rip), %rax     # 0xe4fb8
movq (%rax), %rdi
leaq 0x6a186(%rip), %rsi     # 0xa8922
movq %r15, %rdx
xorl %eax, %eax
popq %rbx
popq %r14
popq %r15
jmp 0xe670
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/R3Shapes/ply.cpp
// Function: ply_describe_other_properties
void ply_describe_other_properties(
  PlyFile *plyfile,
  PlyOtherProp *other,
  int offset
)
{
  int i;
  PlyElement *elem;
  PlyProperty *prop;

  /* look for appropriate element */
  elem = find_element (plyfile, other->name);
  if (elem == NULL) {
    fprintf(stderr, "ply_describe_other_properties: can't find element '%s'\n",
            other->name);
    return;
  }

  /* create room for other properties */

  if (elem->nprops == 0) {
    elem->props = (PlyProperty **)
                  myalloc (sizeof (PlyProperty *) * other->nprops);
    elem->store_prop = (char *) myalloc (sizeof (char) * other->nprops);
    elem->nprops = 0;
  }
  else {
    int newsize;
    newsize = elem->nprops + other->nprops;
    elem->props = (PlyProperty **)
                  realloc (elem->props, sizeof (PlyProperty *) * newsize);
    elem->store_prop = (char *)
                  realloc (elem->store_prop, sizeof (char) * newsize);
  }

  /* copy the other properties */

  for (i = 0; i < other->nprops; i++) {
    prop = (PlyProperty *) myalloc (sizeof (PlyProperty));
    copy_property (prop, other->props[i]);
    elem->props[elem->nprops] = prop;
    elem->store_prop[elem->nprops] = OTHER_PROP;
    elem->nprops++;
  }

  /* save other info about other properties */
  elem->other_size = other->size;
  elem->other_offset = offset;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %edx, %ebx
movq %rsi, %r14
movq (%rsi), %r12
movq %r12, %rsi
callq 0x3e644
testq %rax, %rax
je 0x3e8b8
movq %rax, %r15
movl 0x10(%rax), %eax
movl 0xc(%r14), %edi
testl %eax, %eax
je 0x3e80c
addl %eax, %edi
movq 0x18(%r15), %rax
movslq %edi, %r12
leaq (,%r12,8), %rsi
movq %rax, %rdi
callq 0xe7a0
movq %rax, 0x18(%r15)
movq 0x20(%r15), %rdi
movq %r12, %rsi
callq 0xe7a0
movq %rax, 0x20(%r15)
jmp 0x3e844
shll $0x3, %edi
leaq 0x6a0d5(%rip), %r12     # 0xa88eb
movl $0x17d, %esi            # imm = 0x17D
movq %r12, %rdx
callq 0x3e440
movq %rax, 0x18(%r15)
movl 0xc(%r14), %edi
movl $0x17e, %esi            # imm = 0x17E
movq %r12, %rdx
callq 0x3e440
movq %rax, 0x20(%r15)
movl $0x0, 0x10(%r15)
cmpl $0x0, 0xc(%r14)
jle 0x3e89d
xorl %ebp, %ebp
leaq 0x6a097(%rip), %r12     # 0xa88eb
movl $0x28, %edi
movl $0x18d, %esi            # imm = 0x18D
movq %r12, %rdx
callq 0x3e440
movq %rax, %r13
movq 0x10(%r14), %rax
movq (%rax,%rbp,8), %rsi
movq %r13, %rdi
callq 0x3e68a
movq 0x18(%r15), %rax
movslq 0x10(%r15), %rcx
movq %r13, (%rax,%rcx,8)
movq 0x20(%r15), %rax
movb $0x0, (%rax,%rcx)
incl 0x10(%r15)
incq %rbp
movslq 0xc(%r14), %rax
cmpq %rax, %rbp
jl 0x3e854
movl 0x8(%r14), %eax
movl %eax, 0x2c(%r15)
movl %ebx, 0x28(%r15)
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0xa66f9(%rip), %rax     # 0xe4fb8
movq (%rax), %rdi
leaq 0x6a089(%rip), %rsi     # 0xa8952
movq %r12, %rdx
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0xe670
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/R3Shapes/ply.cpp
// Function: ply_put_element_setup
void ply_put_element_setup(PlyFile *plyfile, char *elem_name)
{
  PlyElement *elem;

  elem = find_element (plyfile, elem_name);
  if (elem == NULL) {
    fprintf(stderr, "ply_elements_setup: can't find element '%s'\n", elem_name);
    exit (-1);
  }

  plyfile->which_elem = elem;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
callq 0x3e644
testq %rax, %rax
je 0x3eb40
movq %rax, 0x40(%r14)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
movq %rbx, %rdi
callq 0xeb71
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/R3Shapes/ply.cpp
// Function: get_stored_item(void*, int, int*, unsigned int*, double*)
void get_stored_item(
  void *ptr,
  int type,
  int *int_val,
  unsigned int *uint_val,
  double *double_val
)
{
  switch (type) {
    case PLY_CHAR:
      *int_val = *((char *) ptr);
      *uint_val = *int_val;
      *double_val = *int_val;
      break;
    case PLY_UCHAR:
      *uint_val = *((unsigned char *) ptr);
      *int_val = *uint_val;
      *double_val = *uint_val;
      break;
    case PLY_SHORT:
      *int_val = *((short int *) ptr);
      *uint_val = (*int_val >= 0) ? *int_val : 0;
      *double_val = *int_val;
      break;
    case PLY_USHORT:
      *uint_val = *((unsigned short int *) ptr);
      *int_val = *uint_val;
      *double_val = *uint_val;
      break;
    case PLY_INT:
      *int_val = *((int *) ptr);
      *uint_val = (*int_val >= 0) ? *int_val : 0;
      *double_val = *int_val;
      break;
    case PLY_UINT:
      *uint_val = *((unsigned int *) ptr);
      *int_val = *uint_val;
      *double_val = *uint_val;
      break;
    case PLY_FLOAT:
      *double_val = *((float *) ptr);
      *int_val = (int) *double_val;
      *uint_val = (*double_val >= 0) ? (unsigned int) *double_val : 0;
      break;
    case PLY_DOUBLE:
      *double_val = *((double *) ptr);
      *int_val = (int) *double_val;
      *uint_val = (*double_val >= 0) ? (unsigned int) *double_val : 0;
      break;
    default:
      fprintf (stderr, "get_stored_item: bad type = %d\n", type);
      exit (-1);
  }
}

// Assembly:
leal -0x1(%rsi), %eax
cmpl $0x7, %eax
ja 0x3eedc
leaq 0x69994(%rip), %rsi     # 0xa87e0
movslq (%rsi,%rax,4), %rax
addq %rsi, %rax
jmpq *%rax
movsbl (%rdi), %eax
movl %eax, (%rdx)
movl %eax, (%rcx)
jmp 0x3eea1
movzwl (%rdi), %eax
jmp 0x3eea9
movl (%rdi), %eax
movl %eax, (%rdx)
xorl %esi, %esi
testl %eax, %eax
cmovgl %eax, %esi
jmp 0x3ee9f
movzbl (%rdi), %eax
jmp 0x3eea9
movsd (%rdi), %xmm0
movsd %xmm0, (%r8)
cvttsd2si %xmm0, %eax
movl %eax, (%rdx)
xorpd %xmm1, %xmm1
maxsd %xmm1, %xmm0
cvttsd2si %xmm0, %rax
jmp 0x3eed9
movswl (%rdi), %eax
xorl %esi, %esi
testl %eax, %eax
movl %eax, (%rdx)
cmovnsl %eax, %esi
movl %esi, (%rcx)
cvtsi2sdl (%rdx), %xmm0
jmp 0x3eeb4
movl (%rdi), %eax
movl %eax, (%rcx)
movl %eax, (%rdx)
movl (%rcx), %eax
cvtsi2sd %rax, %xmm0
movsd %xmm0, (%r8)
retq
movss (%rdi), %xmm0
cvtss2sd %xmm0, %xmm1
movsd %xmm1, (%r8)
cvttss2si %xmm0, %eax
movl %eax, (%rdx)
xorps %xmm1, %xmm1
maxss %xmm1, %xmm0
cvttss2si %xmm0, %rax
movl %eax, (%rcx)
retq
pushq %rax
movl %esi, %edi
callq 0xeb95
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/R3Shapes/ply.cpp
// Function: write_binary_item(_IO_FILE*, int, int, unsigned int, double, int)
void write_binary_item(
  FILE *fp,
  int file_type,
  int int_val,
  unsigned int uint_val,
  double double_val,
  int type
)
{
  unsigned char uchar_val;
  char char_val;
  unsigned short ushort_val;
  short short_val;
  float float_val;
  void  *value;
  
  switch (type) {
    case PLY_CHAR:
      char_val = int_val;
      value = &char_val;
      break;
    case PLY_SHORT:
      short_val = int_val;
      value = &short_val;
      break;
    case PLY_INT:
      value = &int_val;
      break;
    case PLY_UCHAR:
      uchar_val = uint_val;
      value = &uchar_val;
      break;
    case PLY_USHORT:
      ushort_val = uint_val;
      value = &ushort_val;
      break;
    case PLY_UINT:
      value = &uint_val;
      break;
    case PLY_FLOAT:
      float_val = double_val;
      value = &float_val;
      break;
    case PLY_DOUBLE:
      value = &double_val;
      break;
    default:
      fprintf (stderr, "write_binary_item: bad type = %d\n", type);
      exit (-1);
  }

  if ((file_type != native_binary_type) && (ply_type_size[type] > 1))
     swap_bytes((char *)value, ply_type_size[type]);
  
  fwrite (value, ply_type_size[type], 1, fp);
}

// Assembly:
subq $0x18, %rsp
movq %rdi, %rax
movl %edx, 0xc(%rsp)
movl %ecx, 0x8(%rsp)
movsd %xmm0, 0x10(%rsp)
leal -0x1(%r8), %edi
cmpl $0x7, %edi
ja 0x3f019
leaq 0x6989f(%rip), %r9      # 0xa8800
movslq (%r9,%rdi,4), %rdi
addq %r9, %rdi
jmpq *%rdi
leaq 0x4(%rsp), %rdi
movb %dl, (%rdi)
jmp 0x3efb2
leaq 0x4(%rsp), %rdi
movw %cx, (%rdi)
jmp 0x3efb2
leaq 0xc(%rsp), %rdi
jmp 0x3efb2
leaq 0x4(%rsp), %rdi
movb %cl, (%rdi)
jmp 0x3efb2
leaq 0x10(%rsp), %rdi
jmp 0x3efb2
leaq 0x4(%rsp), %rdi
movw %dx, (%rdi)
jmp 0x3efb2
leaq 0x8(%rsp), %rdi
jmp 0x3efb2
cvtsd2ss %xmm0, %xmm0
leaq 0x4(%rsp), %rdi
movss %xmm0, (%rdi)
movzbl 0x4a7baf(%rip), %edx    # 0x4e6b68
decl %edx
orl $0x3, %edx
movslq %r8d, %rcx
cmpl %esi, %edx
je 0x3effc
leaq 0xa6aa4(%rip), %rdx     # 0xe5a70
movslq (%rdx,%rcx,4), %rsi
cmpq $0x2, %rsi
jl 0x3effc
movl %esi, %edx
shrl %edx
addq %rdi, %rsi
decq %rsi
xorl %r8d, %r8d
movb (%rdi,%r8), %r9b
movb (%rsi), %r10b
movb %r10b, (%rdi,%r8)
movb %r9b, (%rsi)
incq %r8
decq %rsi
cmpq %r8, %rdx
jne 0x3efe3
leaq 0xa6a6d(%rip), %rdx     # 0xe5a70
movslq (%rdx,%rcx,4), %rsi
movl $0x1, %edx
movq %rax, %rcx
callq 0xe8b0
addq $0x18, %rsp
retq
movl %r8d, %edi
callq 0xebdb
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/R3Shapes/ply.cpp
// Function: ply_put_comment
void ply_put_comment(PlyFile *plyfile, char *comment)
{
  /* (re)allocate space for new comment */
  if (plyfile->num_comments == 0)
    plyfile->comments = (char **) myalloc (sizeof (char *));
  else
    plyfile->comments = (char **) realloc (plyfile->comments,
                         sizeof (char *) * (plyfile->num_comments + 1));

  /* add comment to list */
  plyfile->comments[plyfile->num_comments] = my_strdup (comment);
  plyfile->num_comments++;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %r14
movq %rdi, %rbx
movslq 0x20(%rdi), %rax
testq %rax, %rax
je 0x3f047
movq 0x28(%rbx), %rdi
leaq 0x8(,%rax,8), %rsi
callq 0xe7a0
jmp 0x3f05d
leaq 0x6989d(%rip), %rdx     # 0xa88eb
movl $0x8, %edi
movl $0x294, %esi            # imm = 0x294
callq 0x3e440
movq %rax, 0x28(%rbx)
movq %r14, %rdi
callq 0x3e480
movq 0x28(%rbx), %rcx
movslq 0x20(%rbx), %rdx
movq %rax, (%rcx,%rdx,8)
leal 0x1(%rdx), %eax
movl %eax, 0x20(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/R3Shapes/ply.cpp
// Function: ply_put_obj_info
void ply_put_obj_info(PlyFile *plyfile, char *obj_info)
{
  /* (re)allocate space for new info */
  if (plyfile->num_obj_info == 0)
    plyfile->obj_info = (char **) myalloc (sizeof (char *));
  else
    plyfile->obj_info = (char **) realloc (plyfile->obj_info,
                         sizeof (char *) * (plyfile->num_obj_info + 1));

  /* add info to list */
  plyfile->obj_info[plyfile->num_obj_info] = my_strdup (obj_info);
  plyfile->num_obj_info++;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %r14
movq %rdi, %rbx
movslq 0x30(%rdi), %rax
testq %rax, %rax
je 0x3f0a9
movq 0x38(%rbx), %rdi
leaq 0x8(,%rax,8), %rsi
callq 0xe7a0
jmp 0x3f0bf
leaq 0x6983b(%rip), %rdx     # 0xa88eb
movl $0x8, %edi
movl $0x2ac, %esi            # imm = 0x2AC
callq 0x3e440
movq %rax, 0x38(%rbx)
movq %r14, %rdi
callq 0x3e480
movq 0x38(%rbx), %rcx
movslq 0x30(%rbx), %rdx
movq %rax, (%rcx,%rdx,8)
leal 0x1(%rdx), %eax
movl %eax, 0x30(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/R3Shapes/ply.cpp
// Function: add_element(PlyFile*, char**)
void add_element (PlyFile *plyfile, char **words)
{
  PlyElement *elem;

  /* create the new element */
  elem = (PlyElement *) myalloc (sizeof (PlyElement));
  elem->name = my_strdup (words[1]);
  elem->num = atoi (words[2]);
  elem->nprops = 0;

  /* make room for new element in the object's list of elements */
  if (plyfile->nelems == 0)
    plyfile->elems = (PlyElement **) myalloc (sizeof (PlyElement *));
  else
    plyfile->elems = (PlyElement **) realloc (plyfile->elems,
                     sizeof (PlyElement *) * (plyfile->nelems + 1));

  /* add the new element to the object's list */
  plyfile->elems[plyfile->nelems] = elem;
  plyfile->nelems++;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rsi, %r15
movq %rdi, %rbx
leaq 0x6920b(%rip), %rdx     # 0xa88eb
movl $0x30, %edi
movl $0xa00, %esi            # imm = 0xA00
callq 0x3e440
movq %rax, %r14
movq 0x8(%r15), %rdi
callq 0x3e480
movq %rax, (%r14)
movq 0x10(%r15), %rdi
callq 0xe700
movl %eax, 0x8(%r14)
movl $0x0, 0x10(%r14)
movslq 0x10(%rbx), %rax
testq %rax, %rax
je 0x3f72f
movq 0x18(%rbx), %rdi
leaq 0x8(,%rax,8), %rsi
callq 0xe7a0
jmp 0x3f745
leaq 0x691b5(%rip), %rdx     # 0xa88eb
movl $0x8, %edi
movl $0xa07, %esi            # imm = 0xA07
callq 0x3e440
movq %rax, 0x18(%rbx)
movq 0x18(%rbx), %rax
movslq 0x10(%rbx), %rcx
movq %r14, (%rax,%rcx,8)
leal 0x1(%rcx), %eax
movl %eax, 0x10(%rbx)
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/R3Shapes/ply.cpp
// Function: add_property(PlyFile*, char**)
void add_property (PlyFile *plyfile, char **words)
{
  PlyProperty *prop;
  PlyElement *elem;

  /* create the new property */

  prop = (PlyProperty *) myalloc (sizeof (PlyProperty));

  if (equal_strings (words[1], "list")) {       /* is a list */
    prop->count_external = get_prop_type (words[2]);
    prop->external_type = get_prop_type (words[3]);
    prop->name = my_strdup (words[4]);
    prop->is_list = 1;
  }
  else {                                        /* not a list */
    prop->external_type = get_prop_type (words[1]);
    prop->name = my_strdup (words[2]);
    prop->is_list = 0;
  }

  /* add this property to the list of properties of the current element */

  elem = plyfile->elems[plyfile->nelems - 1];

  if (elem->nprops == 0)
    elem->props = (PlyProperty **) myalloc (sizeof (PlyProperty *));
  else
    elem->props = (PlyProperty **) realloc (elem->props,
                  sizeof (PlyProperty *) * (elem->nprops + 1));

  elem->props[elem->nprops] = prop;
  elem->nprops++;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rsi, %r15
movq %rdi, %r14
leaq 0x69175(%rip), %rdx     # 0xa88eb
movl $0x28, %edi
movl $0xa44, %esi            # imm = 0xA44
callq 0x3e440
movq %rax, %rbx
movq 0x8(%r15), %rdi
xorl %ecx, %ecx
leaq 0x696cc(%rip), %rax     # 0xa8e61
leaq 0x696c1(%rip), %rdx     # 0xa8e5d
movb (%rdi,%rcx), %sil
testb %sil, %sil
je 0x3f7ba
cmpq $0x4, %rcx
je 0x3f7c0
leaq 0x1(%rcx), %r8
cmpb (%rcx,%rdx), %sil
movq %r8, %rcx
je 0x3f79c
jmp 0x3f7e2
addq %rcx, %rdx
movq %rdx, %rax
cmpb (%rax), %sil
jne 0x3f7e2
movq 0x10(%r15), %rdi
callq 0x40851
movl %eax, 0x18(%rbx)
movq 0x18(%r15), %rdi
movl $0x1, %ebp
movl $0x20, %r12d
jmp 0x3f7ea
xorl %ebp, %ebp
movl $0x10, %r12d
callq 0x40851
movl %eax, 0x8(%rbx)
movq (%r15,%r12), %rdi
callq 0x3e480
movq %rax, (%rbx)
movl %ebp, 0x14(%rbx)
movq 0x18(%r14), %rax
movslq 0x10(%r14), %rcx
movq -0x8(%rax,%rcx,8), %r14
movslq 0x10(%r14), %rax
testq %rax, %rax
je 0x3f82a
movq 0x18(%r14), %rdi
leaq 0x8(,%rax,8), %rsi
callq 0xe7a0
jmp 0x3f840
leaq 0x690ba(%rip), %rdx     # 0xa88eb
movl $0x8, %edi
movl $0xa57, %esi            # imm = 0xA57
callq 0x3e440
movq %rax, 0x18(%r14)
movq 0x18(%r14), %rax
movslq 0x10(%r14), %rcx
movq %rbx, (%rax,%rcx,8)
leal 0x1(%rcx), %eax
movl %eax, 0x10(%r14)
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/R3Shapes/ply.cpp
// Function: ply_open_for_reading
PlyFile *ply_open_for_reading(
  char *filename,
  int *nelems,
  char ***elem_names,
  int *file_type,
  float *version
)
{
  FILE *fp;
  PlyFile *plyfile;
  char *name;

  /* tack on the extension .ply, if necessary */

  name = (char *) myalloc (sizeof (char) * (strlen (filename) + 5));
  strcpy (name, filename);
  if (strlen (name) < 4 ||
      strcmp (name + strlen (name) - 4, ".ply") != 0)
      strcat (name, ".ply");

  /* open the file for reading */

  fp = fopen (name, "r");
  if (fp == NULL)
    return (NULL);

  /* create the PlyFile data structure */

  plyfile = ply_read (fp, nelems, elem_names);

  /* determine the file type and version */

  *file_type = plyfile->file_type;
  *version = plyfile->version;

  /* return a pointer to the file's information */

  return (plyfile);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %r8, %rbx
movq %rcx, %r14
movq %rdx, %r15
movq %rsi, %r12
movq %rdi, %rbp
callq 0xe1e0
leal 0x5(%rax), %edi
leaq 0x6902e(%rip), %rdx     # 0xa88eb
movl $0x365, %esi            # imm = 0x365
callq 0x3e440
movq %rax, %r13
movq %rax, %rdi
movq %rbp, %rsi
callq 0xe3d0
movq %r13, %rdi
callq 0xe1e0
cmpq $0x4, %rax
jb 0x3f8fb
leaq (%rax,%r13), %rdi
addq $-0x4, %rdi
leaq 0x62a7a(%rip), %rsi     # 0xa236c
callq 0xe640
testl %eax, %eax
je 0x3f912
movq %r13, %rdi
callq 0xe1e0
movl $0x796c702e, (%r13,%rax) # imm = 0x796C702E
movb $0x0, 0x4(%r13,%rax)
leaq 0x6c47a(%rip), %rsi     # 0xabd93
movq %r13, %rdi
callq 0xe530
testq %rax, %rax
je 0x3f945
movq %rax, %rdi
movq %r12, %rsi
movq %r15, %rdx
callq 0x3f0e5
movl 0x8(%rax), %ecx
movl %ecx, (%r14)
movss 0xc(%rax), %xmm0
movss %xmm0, (%rbx)
jmp 0x3f947
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/R3Shapes/ply.cpp
// Function: ply_get_element_description
PlyProperty **ply_get_element_description(
  PlyFile *plyfile,
  char *elem_name,
  int *nelems,
  int *nprops
)
{
  int i;
  PlyElement *elem;
  PlyProperty *prop;
  PlyProperty **prop_list;

  /* find information about the element */
  elem = find_element (plyfile, elem_name);
  if (elem == NULL)
    return (NULL);

  *nelems = elem->num;
  *nprops = elem->nprops;

  /* make a copy of the element's property list */
  prop_list = (PlyProperty **) myalloc (sizeof (PlyProperty *) * elem->nprops);
  for (i = 0; i < elem->nprops; i++) {
    prop = (PlyProperty *) myalloc (sizeof (PlyProperty));
    copy_property (prop, elem->props[i]);
    prop_list[i] = prop;
  }

  /* return this duplicate property list */
  return (prop_list);
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %rcx, %r14
movq %rdx, %r15
callq 0x3e644
testq %rax, %rax
je 0x3f9df
movq %rax, %rbx
movl 0x8(%rax), %eax
movl %eax, (%r15)
movl 0x10(%rbx), %eax
movl %eax, (%r14)
movl 0x10(%rbx), %edi
shll $0x3, %edi
leaq 0x68f60(%rip), %rdx     # 0xa88eb
movl $0x3a2, %esi            # imm = 0x3A2
callq 0x3e440
movq %rax, %r14
cmpl $0x0, 0x10(%rbx)
jle 0x3f9e2
xorl %r13d, %r13d
leaq 0x68f43(%rip), %r15     # 0xa88eb
movl $0x28, %edi
movl $0x3a4, %esi            # imm = 0x3A4
movq %r15, %rdx
callq 0x3e440
movq %rax, %r12
movq 0x18(%rbx), %rax
movq (%rax,%r13,8), %rsi
movq %r12, %rdi
callq 0x3e68a
movq %r12, (%r14,%r13,8)
incq %r13
movslq 0x10(%rbx), %rax
cmpq %rax, %r13
jl 0x3f9a8
jmp 0x3f9e2
xorl %r14d, %r14d
movq %r14, %rax
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/R3Shapes/ply.cpp
// Function: ply_get_element_setup
void ply_get_element_setup(
  PlyFile *plyfile,
  char *elem_name,
  int nprops,
  PlyProperty *prop_list
)
{
  int i;
  PlyElement *elem;
  PlyProperty *prop;
  int index;

  /* find information about the element */
  elem = find_element (plyfile, elem_name);
  plyfile->which_elem = elem;

  /* deposit the property information into the element's description */
  for (i = 0; i < nprops; i++) {

    /* look for actual property */
    prop = find_property (elem, prop_list[i].name, &index);
    if (prop == NULL) {
      fprintf (stderr, "Warning:  Can't find property '%s' in element '%s'\n",
               prop_list[i].name, elem_name);
      continue;
    }

    /* store its description */
    prop->internal_type = prop_list[i].internal_type;
    prop->offset = prop_list[i].offset;
    prop->count_internal = prop_list[i].count_internal;
    prop->count_offset = prop_list[i].count_offset;

    /* specify that the user wants this property */
    elem->store_prop[index] = STORE_PROP;
  }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rcx, %rbx
movl %edx, %ebp
movq %rdi, %r12
movq %rsi, 0x10(%rsp)
callq 0x3e644
movq %rax, 0x40(%r12)
testl %ebp, %ebp
jle 0x3fa90
movq %rax, %r15
movl %ebp, %eax
shlq $0x3, %rax
leaq (%rax,%rax,4), %r13
leaq 0xc(%rsp), %r12
xorl %r14d, %r14d
movq (%rbx,%r14), %rbp
movq %r15, %rdi
movq %rbp, %rsi
movq %r12, %rdx
callq 0x3fa9f
testq %rax, %rax
je 0x3fa6e
movq 0xc(%rbx,%r14), %rcx
movq %rcx, 0xc(%rax)
movq 0x1c(%rbx,%r14), %rcx
movq %rcx, 0x1c(%rax)
movq 0x20(%r15), %rax
movslq 0xc(%rsp), %rcx
movb $0x1, (%rax,%rcx)
addq $0x28, %r14
cmpq %r14, %r13
jne 0x3fa2d
jmp 0x3fa90
movq 0xa5543(%rip), %rax     # 0xe4fb8
movq (%rax), %rdi
leaq 0x69132(%rip), %rsi     # 0xa8bb1
movq %rbp, %rdx
movq 0x10(%rsp), %rcx
xorl %eax, %eax
callq 0xe670
jmp 0x3fa63
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/ply.cpp
// Function: find_property(PlyElement*, char*, int*)
PlyProperty *find_property(PlyElement *elem, char *prop_name, int *index)
{
  int i;

  for (i = 0; i < elem->nprops; i++)
    if (equal_strings (prop_name, elem->props[i]->name)) {
      *index = i;
      return (elem->props[i]);
    }

  *index = -1;
  return (NULL);
}

// Assembly:
movslq 0x10(%rdi), %r8
movl $0xffffffff, %ecx       # imm = 0xFFFFFFFF
testq %r8, %r8
jle 0x3faed
pushq %rbp
pushq %rbx
movq 0x18(%rdi), %rdi
xorl %r9d, %r9d
movq (%rdi,%r9,8), %rax
movq (%rax), %r10
xorl %r11d, %r11d
movb (%rsi,%r11), %bl
testb %bl, %bl
je 0x3fadb
movb (%r10,%r11), %bpl
testb %bpl, %bpl
je 0x3fadb
incq %r11
cmpb %bpl, %bl
je 0x3fac0
jmp 0x3fae1
cmpb (%r10,%r11), %bl
je 0x3faf1
incq %r9
cmpq %r8, %r9
jne 0x3fab6
xorl %eax, %eax
jmp 0x3faf4
xorl %eax, %eax
jmp 0x3faf6
movl %r9d, %ecx
popq %rbx
popq %rbp
movl %ecx, (%rdx)
retq
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/R3Shapes/ply.cpp
// Function: ply_get_property
void ply_get_property(
  PlyFile *plyfile,
  char *elem_name,
  PlyProperty *prop
)
{
  PlyElement *elem;
  PlyProperty *prop_ptr;
  int index;

  /* find information about the element */
  elem = find_element (plyfile, elem_name);
  plyfile->which_elem = elem;

  /* deposit the property information into the element's description */

  prop_ptr = find_property (elem, prop->name, &index);
  if (prop_ptr == NULL) {
    fprintf (stderr, "Warning:  Can't find property '%s' in element '%s'\n",
             prop->name, elem_name);
    return;
  }
  prop_ptr->internal_type  = prop->internal_type;
  prop_ptr->offset         = prop->offset;
  prop_ptr->count_internal = prop->count_internal;
  prop_ptr->count_offset   = prop->count_offset;

  /* specify that the user wants this property */
  elem->store_prop[index] = STORE_PROP;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %r14
movq %rsi, %rbx
movq %rdi, %r12
callq 0x3e644
movq %rax, %r15
movq %rax, 0x40(%r12)
movq (%r14), %r12
leaq 0x4(%rsp), %rdx
movq %rax, %rdi
movq %r12, %rsi
callq 0x3fa9f
testq %rax, %rax
je 0x3fb58
movq 0xc(%r14), %rcx
movq %rcx, 0xc(%rax)
movq 0x1c(%r14), %rcx
movq %rcx, 0x1c(%rax)
movq 0x20(%r15), %rax
movslq 0x4(%rsp), %rcx
movb $0x1, (%rax,%rcx)
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
movq 0xa5459(%rip), %rax     # 0xe4fb8
movq (%rax), %rdi
leaq 0x69048(%rip), %rsi     # 0xa8bb1
movq %r12, %rdx
movq %rbx, %rcx
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
jmp 0xe670
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/R3Shapes/ply.cpp
// Function: ply_describe_other_elements
void ply_describe_other_elements (
  PlyFile *plyfile,
  PlyOtherElems *other_elems
)
{
  int i;
  OtherElem *other;
  PlyElement *elem;
  
  /* ignore this call if there is no other element */
  if (other_elems == NULL)
    return;

  /* save pointer to this information */
  plyfile->other_elems = other_elems;

  /* describe the other properties of this element */
  /* store them in the main element list as elements with
     only other properties */
  
  REALLOCN(plyfile->elems, PlyElement *,
	   plyfile->nelems, plyfile->nelems + other_elems->num_elems);
  for (i = 0; i < other_elems->num_elems; i++) {
      other = &(other_elems->other_list[i]);
      elem = (PlyElement *) myalloc (sizeof (PlyElement));
      plyfile->elems[plyfile->nelems++] = elem;
      elem->name = my_strdup (other->elem_name);
      elem->num = other->elem_count;
      elem->nprops = 0;
      ply_describe_other_properties (plyfile, other->other_props,
				     offsetof(OtherData,other_props));
  }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
testq %rsi, %rsi
je 0x4043d
movq %rsi, %rbx
movq %rdi, %r14
movq %rsi, 0x48(%rdi)
movslq 0x10(%rdi), %rax
testq %rax, %rax
je 0x403ac
leaq 0x10(%r14), %r15
movq 0x18(%r14), %rdi
movslq (%rbx), %rsi
addq %rax, %rsi
shlq $0x3, %rsi
callq 0xe7a0
movq %rax, 0x18(%r14)
testq %rax, %rax
jne 0x40390
movl (%r15), %ecx
addl (%rbx), %ecx
jne 0x40451
movslq (%rbx), %rdx
testq %rdx, %rdx
jle 0x403c5
movslq (%r15), %rcx
leaq (%rax,%rcx,8), %rdi
shlq $0x3, %rdx
xorl %esi, %esi
callq 0xe260
jmp 0x403c5
movl (%rbx), %edi
movl $0x8, %esi
callq 0xe2f0
movq %rax, 0x18(%r14)
testq %rax, %rax
je 0x4044c
cmpl $0x0, (%rbx)
jle 0x4043d
xorl %r13d, %r13d
xorl %ebp, %ebp
movq 0x8(%rbx), %r15
movl $0x30, %edi
movl $0x54f, %esi            # imm = 0x54F
leaq 0x68507(%rip), %rdx     # 0xa88eb
callq 0x3e440
movq %rax, %r12
movq 0x18(%r14), %rax
movslq 0x10(%r14), %rcx
leal 0x1(%rcx), %edx
movl %edx, 0x10(%r14)
movq %r12, (%rax,%rcx,8)
movq (%r15,%r13), %rdi
callq 0x3e480
movq %rax, (%r12)
movl 0x8(%r15,%r13), %eax
movl %eax, 0x8(%r12)
movl $0x0, 0x10(%r12)
movq 0x18(%r15,%r13), %rsi
movq %r14, %rdi
xorl %edx, %edx
callq 0x3e7ab
incq %rbp
movslq (%rbx), %rax
addq $0x20, %r13
cmpq %rax, %rbp
jl 0x403cf
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
callq 0xecfc
movq %r15, %rdi
movq %rbx, %rsi
callq 0xecad
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/R3Shapes/ply.cpp
// Function: ply_put_other_elements
void ply_put_other_elements (PlyFile *plyfile)
{
  int i,j;
  OtherElem *other;

  /* make sure we have other elements to write */
  if (plyfile->other_elems == NULL)
    return;

  /* write out the data for each "other" element */

  for (i = 0; i < plyfile->other_elems->num_elems; i++) {

    other = &(plyfile->other_elems->other_list[i]);
    ply_put_element_setup (plyfile, other->elem_name);

    /* write out each instance of the current element */
    for (j = 0; j < other->elem_count; j++)
      ply_put_element (plyfile, (void *) other->other_data[j]);
  }
}

// Assembly:
cmpq $0x0, 0x48(%rdi)
je 0x404d5
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq 0x48(%rdi), %rax
cmpl $0x0, (%rax)
jle 0x404ca
xorl %r14d, %r14d
movq 0x8(%rax), %r15
movq %r14, %r12
shlq $0x5, %r12
movq (%r15,%r12), %rsi
movq %rbx, %rdi
callq 0x3eb20
cmpl $0x0, 0x8(%r15,%r12)
jle 0x404bb
addq %r12, %r15
xorl %r12d, %r12d
movq 0x10(%r15), %rax
movq (%rax,%r12,8), %rsi
movq %rbx, %rdi
callq 0x3eb48
incq %r12
movslq 0x8(%r15), %rax
cmpq %rax, %r12
jl 0x4049f
incq %r14
movq 0x48(%rbx), %rax
movslq (%rax), %rcx
cmpq %rcx, %r14
jl 0x4047a
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/R3Shapes/ply.cpp
// Function: get_ascii_item(char*, int, int*, unsigned int*, double*)
void get_ascii_item(
  char *word,
  int type,
  int *int_val,
  unsigned int *uint_val,
  double *double_val
)
{
  switch (type) {
    case PLY_CHAR:
    case PLY_UCHAR:
    case PLY_SHORT:
    case PLY_USHORT:
    case PLY_INT:
      *int_val = atoi (word);
      *uint_val = (*int_val >= 0) ? (unsigned int) *int_val : 0;
      *double_val = (double) *int_val;
      break;

    case PLY_UINT:
      *uint_val = strtol (word, (char **) NULL, 10);
      *int_val = (int) *uint_val;
      *double_val = (double) *uint_val;
      break;

    case PLY_FLOAT:
    case PLY_DOUBLE:
      *double_val = atof (word);
      *int_val = (int) *double_val;
      *uint_val = (*double_val >= 0) ? (unsigned int) *double_val : 0;
      break;

    default:
      fprintf (stderr, "get_ascii_item: bad type = %d\n", type);
      exit (-1);
  }
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %r8, %r14
movq %rcx, %rbx
movq %rdx, %r15
leal -0x1(%rsi), %eax
cmpl $0x5, %eax
jae 0x4053c
callq 0xe700
movl %eax, (%r15)
xorl %ecx, %ecx
testl %eax, %eax
cmovgl %eax, %ecx
movl %ecx, (%rbx)
cvtsi2sdl (%r15), %xmm0
movsd %xmm0, (%r14)
jmp 0x40564
leal -0x7(%rsi), %eax
cmpl $0x2, %eax
jae 0x4056a
callq 0xe580
movsd %xmm0, (%r14)
cvttsd2si %xmm0, %eax
movl %eax, (%r15)
xorpd %xmm1, %xmm1
maxsd %xmm1, %xmm0
cvttsd2si %xmm0, %rax
movl %eax, (%rbx)
popq %rbx
popq %r14
popq %r15
retq
cmpl $0x6, %esi
jne 0x40589
xorl %esi, %esi
movl $0xa, %edx
callq 0xe650
movl %eax, (%rbx)
movl %eax, (%r15)
movl (%rbx), %eax
cvtsi2sd %rax, %xmm0
jmp 0x40535
movl %esi, %edi
callq 0xed29
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/R3Shapes/ply.cpp
// Function: swap_bytes(char*, int)
void swap_bytes(char *bytes, int num_bytes)
{
    int i;
    char temp;
    
    for (i=0; i < num_bytes/2; i++)
    {
	temp = bytes[i];
	bytes[i] = bytes[(num_bytes-1)-i];
	bytes[(num_bytes-1)-i] = temp;
    }
}

// Assembly:
cmpl $0x2, %esi
jl 0x4076f
movl %esi, %eax
shrl %esi
addq %rdi, %rax
decq %rax
negq %rsi
xorl %ecx, %ecx
movb (%rdi), %dl
movb (%rax,%rcx), %r8b
movb %r8b, (%rdi)
movb %dl, (%rax,%rcx)
incq %rdi
decq %rcx
cmpq %rcx, %rsi
jne 0x40758
retq
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/R3Shapes/ply.cpp
// Function: get_prop_type(char*)
int get_prop_type(char *type_name)
{
  int i;

  for (i = PLY_START_TYPE + 1; i < PLY_END_TYPE; i++)
    if (equal_strings (type_name, type_names[i]))
      return (i);

  static char *new_type_names[] = {
    "invalid",
    "int8", "int16", "int32",
    "uint8", "uint16", "uint32",
    "float32", "float64",
  };

  for (i = PLY_START_TYPE + 1; i < PLY_END_TYPE; i++)
    if (equal_strings (type_name, new_type_names[i]))
      return (i);

  /* if we get here, we didn't find the type */
  return (0);
}

// Assembly:
movl $0x1, %eax
leaq 0xa51c3(%rip), %rcx     # 0xe5a20
movq (%rcx,%rax,8), %rdx
xorl %esi, %esi
movb (%rdi,%rsi), %r8b
testb %r8b, %r8b
je 0x4087f
movb (%rdx,%rsi), %r9b
testb %r9b, %r9b
je 0x4087f
incq %rsi
cmpb %r9b, %r8b
je 0x40863
jmp 0x40885
cmpb (%rdx,%rsi), %r8b
je 0x408d4
incq %rax
cmpq $0x9, %rax
jne 0x4085d
movl $0x1, %eax
leaq 0x68006(%rip), %rcx     # 0xa88a0
movslq (%rcx,%rax,4), %rdx
xorl %esi, %esi
movb (%rdi,%rsi), %r8b
testb %r8b, %r8b
je 0x408c0
leaq (%rdx,%rsi), %r9
movb (%rcx,%r9), %r9b
testb %r9b, %r9b
je 0x408c0
incq %rsi
cmpb %r9b, %r8b
je 0x408a0
jmp 0x408c9
addq %rsi, %rdx
cmpb (%rcx,%rdx), %r8b
je 0x408d4
incq %rax
cmpq $0x9, %rax
jne 0x4089a
xorl %eax, %eax
retq
nopl (%rax)
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/R3Shapes/R3Draw.cpp
// Function: gaps::R3Triad::Draw() const
void R3Triad::
Draw(void) const
{
    // Draw three rays
    R3BeginLine();
    R3LoadPoint(R3zero_point);
    R3LoadPoint((R3zero_point + Axis(RN_X)));
    R3EndLine();
    R3BeginLine();
    R3LoadPoint(R3zero_point);
    R3LoadPoint((R3zero_point + Axis(RN_Y)));
    R3EndLine();
    R3BeginLine();
    R3LoadPoint(R3zero_point);
    R3LoadPoint((R3zero_point + Axis(RN_Z)));
    R3EndLine();
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x20, %rsp
movq %rdi, %rbx
movl $0x3, %edi
callq 0xe110
leaq 0x4a60df(%rip), %r14    # 0x4e6a60
movq %r14, %rdi
callq 0xe130
leaq 0x8(%rsp), %r15
movq %r15, %rdi
movq %r14, %rsi
movq %rbx, %rdx
callq 0x3cd71
movq %r15, %rdi
callq 0xe130
callq 0xe5d0
movl $0x3, %edi
callq 0xe110
movq %r14, %rdi
callq 0xe130
leaq 0x18(%rbx), %rdx
leaq 0x8(%rsp), %r15
movq %r15, %rdi
movq %r14, %rsi
callq 0x3cd71
movq %r15, %rdi
callq 0xe130
callq 0xe5d0
movl $0x3, %edi
callq 0xe110
movq %r14, %rdi
callq 0xe130
addq $0x30, %rbx
leaq 0x8(%rsp), %r15
movq %r15, %rdi
movq %r14, %rsi
movq %rbx, %rdx
callq 0x3cd71
movq %r15, %rdi
callq 0xe130
callq 0xe5d0
addq $0x20, %rsp
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/R3Shapes/R3Draw.cpp
// Function: gaps::R3CoordSystem::Draw() const
void R3CoordSystem::
Draw(void) const
{
    // Draw three rays
    R3BeginLine();
    R3LoadPoint(Origin());
    R3LoadPoint((Origin() + Axes().Axis(RN_X)));
    R3EndLine();
    R3BeginLine();
    R3LoadPoint(Origin());
    R3LoadPoint((Origin() + Axes().Axis(RN_Y)));
    R3EndLine();
    R3BeginLine();
    R3LoadPoint(Origin());
    R3LoadPoint((Origin() + Axes().Axis(RN_Z)));
    R3EndLine();
}

// Assembly:
pushq %r14
pushq %rbx
subq $0x18, %rsp
movq %rdi, %rbx
movl $0x3, %edi
callq 0xe110
movq %rbx, %rdi
callq 0xe130
leaq 0x18(%rbx), %rdx
movq %rsp, %r14
movq %r14, %rdi
movq %rbx, %rsi
callq 0x3cd71
movq %r14, %rdi
callq 0xe130
callq 0xe5d0
movl $0x3, %edi
callq 0xe110
movq %rbx, %rdi
callq 0xe130
leaq 0x30(%rbx), %rdx
movq %rsp, %r14
movq %r14, %rdi
movq %rbx, %rsi
callq 0x3cd71
movq %r14, %rdi
callq 0xe130
callq 0xe5d0
movl $0x3, %edi
callq 0xe110
movq %rbx, %rdi
callq 0xe130
leaq 0x48(%rbx), %rdx
movq %rsp, %r14
movq %r14, %rdi
movq %rbx, %rsi
callq 0x3cd71
movq %r14, %rdi
callq 0xe130
callq 0xe5d0
addq $0x18, %rsp
popq %rbx
popq %r14
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/R3Shapes/R3Draw.cpp
// Function: gaps::R3Affine::Load() const
void R3Affine::
Load(void) const
{
    // Load matrix onto stack
    Matrix().Load();

    // Set mirror flag
    if (IsMirrored()) {
        R3draw_mirrored = !R3draw_mirrored;
#if (RN_3D_GRFX == RN_OPENGL)
        glFrontFace((R3draw_mirrored) ? GL_CW : GL_CCW);
#else
	RNAbort("Not Implemented");
#endif
    }
}

// Assembly:
pushq %r14
pushq %rbx
subq $0x88, %rsp
movq %rdi, %rbx
leaq 0x8(%rdi), %rsi
leaq 0x8(%rsp), %r14
movq %r14, %rdi
callq 0x2cd34
movq %r14, %rdi
callq 0xe4f0
movq (%rbx), %rax
movq %rbx, %rdi
callq *0x18(%rax)
testl %eax, %eax
je 0x40b13
xorl %edi, %edi
cmpl $0x0, 0x4a6072(%rip)    # 0x4e6b70
sete %dil
movl %edi, 0x4a6068(%rip)    # 0x4e6b70
xorl $0x901, %edi            # imm = 0x901
callq 0xe0d0
addq $0x88, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/R3Shapes/R3Draw.cpp
// Function: gaps::R3Affine::Draw() const
void R3Affine::
Draw(void) const
{
    // Multiply top of stack by matrix
    Matrix().Draw();

    // Set mirror flag - this screws up Push/Pop ???
    if (IsMirrored()) {
        R3draw_mirrored = !R3draw_mirrored;
#if (RN_3D_GRFX == RN_OPENGL)
        glFrontFace((R3draw_mirrored) ? GL_CW : GL_CCW);
#else
	RNAbort("Not Implemented");
#endif
    }
}

// Assembly:
pushq %r14
pushq %rbx
subq $0x88, %rsp
movq %rdi, %rbx
leaq 0x8(%rdi), %rsi
leaq 0x8(%rsp), %r14
movq %r14, %rdi
callq 0x2cd34
movq %r14, %rdi
callq 0xe050
movq (%rbx), %rax
movq %rbx, %rdi
callq *0x18(%rax)
testl %eax, %eax
je 0x40b6f
xorl %edi, %edi
cmpl $0x0, 0x4a6016(%rip)    # 0x4e6b70
sete %dil
movl %edi, 0x4a600c(%rip)    # 0x4e6b70
xorl $0x901, %edi            # imm = 0x901
callq 0xe0d0
addq $0x88, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/R3Shapes/R3Draw.cpp
// Function: gaps::R3Affine::Push() const
void R3Affine::
Push(void) const
{
    // Push matrix onto stack
    Matrix().Push();

    // Set mirror flag
    if (IsMirrored()) {
        R3draw_mirrored = !R3draw_mirrored;
#if (RN_3D_GRFX == RN_OPENGL)
        glFrontFace((R3draw_mirrored) ? GL_CW : GL_CCW);
#else
	RNAbort("Not Implemented");
#endif
    }
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
addq $0x8, %rdi
callq 0x40928
movq (%rbx), %rax
movq %rbx, %rdi
callq *0x18(%rax)
testl %eax, %eax
je 0x40bb3
xorl %edi, %edi
cmpl $0x0, 0x4a5fd3(%rip)    # 0x4e6b70
sete %dil
movl %edi, 0x4a5fc9(%rip)    # 0x4e6b70
xorl $0x901, %edi            # imm = 0x901
popq %rbx
jmp 0xe0d0
popq %rbx
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/R3Shapes/R3Draw.cpp
// Function: gaps::R3Affine::Pop() const
void R3Affine::
Pop(void) const
{
    // Pop matrix off stack
    Matrix().Pop();

    // Restore mirror flag
    if (IsMirrored()) {
        R3draw_mirrored = !R3draw_mirrored;
#if (RN_3D_GRFX == RN_OPENGL)
        glFrontFace((R3draw_mirrored) ? GL_CW : GL_CCW);
#else
	RNAbort("Not Implemented");
#endif
    }
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
callq 0xe850
movq (%rbx), %rax
movq %rbx, %rdi
callq *0x18(%rax)
testl %eax, %eax
je 0x40beb
xorl %edi, %edi
cmpl $0x0, 0x4a5f9b(%rip)    # 0x4e6b70
sete %dil
movl %edi, 0x4a5f91(%rip)    # 0x4e6b70
xorl $0x901, %edi            # imm = 0x901
popq %rbx
jmp 0xe0d0
popq %rbx
retq
nop