LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: 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:
subq $0x58, %rsp
movq %rdi, 0x48(%rsp)
movl %esi, 0x44(%rsp)
movq %rdx, 0x38(%rsp)
movl %ecx, 0x34(%rsp)
movq %r8, 0x28(%rsp)
movq 0x48(%rsp), %rdi
callq 0xf200
addq $0x5, %rax
shlq $0x0, %rax
movl %eax, %edi
movl $0xe5, %esi
leaq 0xc3bc4(%rip), %rdx     # 0x1352ef
callq 0x71630
movq %rax, 0x18(%rsp)
movq 0x18(%rsp), %rdi
movq 0x48(%rsp), %rsi
callq 0xf450
movq 0x18(%rsp), %rdi
callq 0xf200
cmpq $0x4, %rax
jb 0x71785
movq 0x18(%rsp), %rax
movq %rax, 0x8(%rsp)
movq 0x18(%rsp), %rdi
callq 0xf200
movq 0x8(%rsp), %rdi
addq %rax, %rdi
addq $-0x4, %rdi
leaq 0xc1c14(%rip), %rsi     # 0x13338f
callq 0xf700
cmpl $0x0, %eax
je 0x71796
movq 0x18(%rsp), %rdi
leaq 0xc1bfe(%rip), %rsi     # 0x13338f
callq 0xf8b0
movq 0x18(%rsp), %rdi
leaq 0xc2b51(%rip), %rsi     # 0x1342f3
callq 0xf5e0
movq %rax, 0x10(%rsp)
cmpq $0x0, 0x10(%rsp)
jne 0x717bf
movq $0x0, 0x50(%rsp)
jmp 0x7180b
movq 0x10(%rsp), %rdi
movl 0x44(%rsp), %esi
movq 0x38(%rsp), %rdx
movl 0x34(%rsp), %ecx
callq 0x71360
movq %rax, 0x20(%rsp)
cmpq $0x0, 0x20(%rsp)
jne 0x717ee
movq $0x0, 0x50(%rsp)
jmp 0x7180b
movq 0x20(%rsp), %rax
movss 0xc(%rax), %xmm0
movq 0x28(%rsp), %rax
movss %xmm0, (%rax)
movq 0x20(%rsp), %rax
movq %rax, 0x50(%rsp)
movq 0x50(%rsp), %rax
addq $0x58, %rsp
retq
nopw %cs:(%rax,%rax)
// File: 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:
subq $0x38, %rsp
movq %rdi, 0x30(%rsp)
movq %rsi, 0x28(%rsp)
movl %edx, 0x24(%rsp)
movl %ecx, 0x20(%rsp)
movq %r8, 0x18(%rsp)
movq 0x30(%rsp), %rdi
movq 0x28(%rsp), %rsi
callq 0x71970
movq %rax, 0x8(%rsp)
cmpq $0x0, 0x8(%rsp)
jne 0x7187e
movq 0xfd76a(%rip), %rax     # 0x16efc8
movq (%rax), %rdi
movq 0x28(%rsp), %rdx
leaq 0xc3a8a(%rip), %rsi     # 0x1352f7
movb $0x0, %al
callq 0xf730
movl $0xffffffff, %edi       # imm = 0xFFFFFFFF
callq 0xf600
movl 0x24(%rsp), %ecx
movq 0x8(%rsp), %rax
movl %ecx, 0x8(%rax)
movl 0x20(%rsp), %ecx
movq 0x8(%rsp), %rax
movl %ecx, 0x10(%rax)
movslq 0x20(%rsp), %rax
shlq $0x3, %rax
movl %eax, %edi
movl $0x124, %esi            # imm = 0x124
leaq 0xc3a42(%rip), %rdx     # 0x1352ef
callq 0x71630
movq %rax, %rcx
movq 0x8(%rsp), %rax
movq %rcx, 0x18(%rax)
movslq 0x20(%rsp), %rax
shlq $0x0, %rax
movl %eax, %edi
movl $0x125, %esi            # imm = 0x125
leaq 0xc3a1a(%rip), %rdx     # 0x1352ef
callq 0x71630
movq %rax, %rcx
movq 0x8(%rsp), %rax
movq %rcx, 0x20(%rax)
movl $0x0, 0x14(%rsp)
movl 0x14(%rsp), %eax
cmpl 0x20(%rsp), %eax
jge 0x71961
movl $0x28, %edi
movl $0x128, %esi            # imm = 0x128
leaq 0xc39e6(%rip), %rdx     # 0x1352ef
callq 0x71630
movq %rax, (%rsp)
movq (%rsp), %rdx
movq 0x8(%rsp), %rax
movq 0x18(%rax), %rax
movslq 0x14(%rsp), %rcx
movq %rdx, (%rax,%rcx,8)
movq 0x8(%rsp), %rax
movq 0x20(%rax), %rax
movslq 0x14(%rsp), %rcx
movb $0x1, (%rax,%rcx)
movq (%rsp), %rdi
movq 0x18(%rsp), %rsi
movslq 0x14(%rsp), %rax
imulq $0x28, %rax, %rax
addq %rax, %rsi
callq 0x71a00
movl 0x14(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x14(%rsp)
jmp 0x718ee
addq $0x38, %rsp
retq
nopw %cs:(%rax,%rax)
// File: 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:
subq $0x28, %rsp
movq %rdi, 0x18(%rsp)
movq %rsi, 0x10(%rsp)
movl $0x0, 0xc(%rsp)
movl 0xc(%rsp), %eax
movq 0x18(%rsp), %rcx
cmpl 0x10(%rcx), %eax
jge 0x719e0
movq 0x10(%rsp), %rdi
movq 0x18(%rsp), %rax
movq 0x18(%rax), %rax
movslq 0xc(%rsp), %rcx
movq (%rax,%rcx,8), %rax
movq (%rax), %rsi
callq 0x734b0
cmpl $0x0, %eax
je 0x719d1
movq 0x18(%rsp), %rax
movq 0x18(%rax), %rax
movslq 0xc(%rsp), %rcx
movq (%rax,%rcx,8), %rax
movq %rax, 0x20(%rsp)
jmp 0x719e9
jmp 0x719d3
movl 0xc(%rsp), %eax
addl $0x1, %eax
movl %eax, 0xc(%rsp)
jmp 0x71986
movq $0x0, 0x20(%rsp)
movq 0x20(%rsp), %rax
addq $0x28, %rsp
retq
nopw %cs:(%rax,%rax)
// File: 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:
subq $0x18, %rsp
movq %rdi, 0x10(%rsp)
movq %rsi, 0x8(%rsp)
movq 0x8(%rsp), %rax
movq (%rax), %rdi
callq 0x71680
movq %rax, %rcx
movq 0x10(%rsp), %rax
movq %rcx, (%rax)
movq 0x8(%rsp), %rax
movl 0x8(%rax), %ecx
movq 0x10(%rsp), %rax
movl %ecx, 0x8(%rax)
movq 0x8(%rsp), %rax
movl 0xc(%rax), %ecx
movq 0x10(%rsp), %rax
movl %ecx, 0xc(%rax)
movq 0x8(%rsp), %rax
movl 0x10(%rax), %ecx
movq 0x10(%rsp), %rax
movl %ecx, 0x10(%rax)
movq 0x8(%rsp), %rax
movl 0x14(%rax), %ecx
movq 0x10(%rsp), %rax
movl %ecx, 0x14(%rax)
movq 0x8(%rsp), %rax
movl 0x18(%rax), %ecx
movq 0x10(%rsp), %rax
movl %ecx, 0x18(%rax)
movq 0x8(%rsp), %rax
movl 0x1c(%rax), %ecx
movq 0x10(%rsp), %rax
movl %ecx, 0x1c(%rax)
movq 0x8(%rsp), %rax
movl 0x20(%rax), %ecx
movq 0x10(%rsp), %rax
movl %ecx, 0x20(%rax)
addq $0x18, %rsp
retq
nopl (%rax,%rax)
// File: 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:
subq $0x28, %rsp
movq %rdi, 0x20(%rsp)
movq %rsi, 0x18(%rsp)
movq %rdx, 0x10(%rsp)
movq 0x20(%rsp), %rdi
movq 0x18(%rsp), %rsi
callq 0x71970
movq %rax, 0x8(%rsp)
cmpq $0x0, 0x8(%rsp)
jne 0x71af1
movq 0xfd4f2(%rip), %rax     # 0x16efc8
movq (%rax), %rdi
movq 0x18(%rsp), %rdx
leaq 0xc3841(%rip), %rsi     # 0x135326
movb $0x0, %al
callq 0xf730
jmp 0x71c0c
movq 0x8(%rsp), %rax
cmpl $0x0, 0x10(%rax)
jne 0x71b4e
movl $0x8, %edi
movl $0x14d, %esi            # imm = 0x14D
leaq 0xc37e2(%rip), %rdx     # 0x1352ef
callq 0x71630
movq %rax, %rcx
movq 0x8(%rsp), %rax
movq %rcx, 0x18(%rax)
movl $0x1, %edi
movl $0x14e, %esi            # imm = 0x14E
leaq 0xc37c0(%rip), %rdx     # 0x1352ef
callq 0x71630
movq %rax, %rcx
movq 0x8(%rsp), %rax
movq %rcx, 0x20(%rax)
movq 0x8(%rsp), %rax
movl $0x1, 0x10(%rax)
jmp 0x71baa
movq 0x8(%rsp), %rax
movl 0x10(%rax), %ecx
addl $0x1, %ecx
movl %ecx, 0x10(%rax)
movq 0x8(%rsp), %rax
movq 0x18(%rax), %rdi
movq 0x8(%rsp), %rax
movslq 0x10(%rax), %rsi
shlq $0x3, %rsi
callq 0xf850
movq %rax, %rcx
movq 0x8(%rsp), %rax
movq %rcx, 0x18(%rax)
movq 0x8(%rsp), %rax
movq 0x20(%rax), %rdi
movq 0x8(%rsp), %rax
movslq 0x10(%rax), %rsi
shlq $0x0, %rsi
callq 0xf850
movq %rax, %rcx
movq 0x8(%rsp), %rax
movq %rcx, 0x20(%rax)
movl $0x28, %edi
movl $0x15b, %esi            # imm = 0x15B
leaq 0xc3734(%rip), %rdx     # 0x1352ef
callq 0x71630
movq %rax, (%rsp)
movq (%rsp), %rdx
movq 0x8(%rsp), %rax
movq 0x18(%rax), %rax
movq 0x8(%rsp), %rcx
movl 0x10(%rcx), %ecx
subl $0x1, %ecx
movslq %ecx, %rcx
movq %rdx, (%rax,%rcx,8)
movq 0x8(%rsp), %rax
movq 0x20(%rax), %rax
movq 0x8(%rsp), %rcx
movl 0x10(%rcx), %ecx
subl $0x1, %ecx
movslq %ecx, %rcx
movb $0x1, (%rax,%rcx)
movq (%rsp), %rdi
movq 0x10(%rsp), %rsi
callq 0x71a00
addq $0x28, %rsp
retq
nopw %cs:(%rax,%rax)
// File: tomfunkhouser[P]gaps/pkgs/R3Shapes/ply.cpp
// Function: ply_element_count
void ply_element_count(
  PlyFile *plyfile,
  char *elem_name,
  int nelems
)
{
  PlyElement *elem;

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

  elem->num = nelems;
}

// Assembly:
subq $0x28, %rsp
movq %rdi, 0x20(%rsp)
movq %rsi, 0x18(%rsp)
movl %edx, 0x14(%rsp)
movq 0x20(%rsp), %rdi
movq 0x18(%rsp), %rsi
callq 0x71970
movq %rax, 0x8(%rsp)
cmpq $0x0, 0x8(%rsp)
jne 0x71e65
movq 0xfd183(%rip), %rax     # 0x16efc8
movq (%rax), %rdi
movq 0x18(%rsp), %rdx
leaq 0xc353a(%rip), %rsi     # 0x13538e
movb $0x0, %al
callq 0xf730
movl $0xffffffff, %edi       # imm = 0xFFFFFFFF
callq 0xf600
movl 0x14(%rsp), %ecx
movq 0x8(%rsp), %rax
movl %ecx, 0x8(%rax)
addq $0x28, %rsp
retq
nopw %cs:(%rax,%rax)
// File: tomfunkhouser[P]gaps/pkgs/R3Shapes/ply.cpp
// Function: write_scalar_type(_IO_FILE*, int)
void write_scalar_type (FILE *fp, int code)
{
  /* make sure this is a valid code */

  if (code <= PLY_START_TYPE || code >= PLY_END_TYPE) {
    fprintf (stderr, "write_scalar_type: bad data code = %d\n", code);
    exit (-1);
  }

  /* write the code to a file */

  fprintf (fp, "%s", type_names[code]);
}

// Assembly:
subq $0x18, %rsp
movq %rdi, 0x10(%rsp)
movl %esi, 0xc(%rsp)
cmpl $0x0, 0xc(%rsp)
jle 0x7215b
cmpl $0x9, 0xc(%rsp)
jl 0x72181
movq 0xfce66(%rip), %rax     # 0x16efc8
movq (%rax), %rdi
movl 0xc(%rsp), %edx
leaq 0xc35fe(%rip), %rsi     # 0x13576e
movb $0x0, %al
callq 0xf730
movl $0xffffffff, %edi       # imm = 0xFFFFFFFF
callq 0xf600
movq 0x10(%rsp), %rdi
movslq 0xc(%rsp), %rcx
leaq 0x1060fe(%rip), %rax    # 0x178290
movq (%rax,%rcx,8), %rdx
leaq 0xc2851(%rip), %rsi     # 0x1349ee
movb $0x0, %al
callq 0xf730
addq $0x18, %rsp
retq
nopl (%rax)
// File: 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:
subq $0x18, %rsp
movq %rdi, 0x10(%rsp)
movq %rsi, 0x8(%rsp)
movq 0x10(%rsp), %rdi
movq 0x8(%rsp), %rsi
callq 0x71970
movq %rax, (%rsp)
cmpq $0x0, (%rsp)
jne 0x721ff
movq 0xfcde9(%rip), %rax     # 0x16efc8
movq (%rax), %rdi
movq 0x8(%rsp), %rdx
leaq 0xc3298(%rip), %rsi     # 0x135486
movb $0x0, %al
callq 0xf730
movl $0xffffffff, %edi       # imm = 0xFFFFFFFF
callq 0xf600
movq (%rsp), %rcx
movq 0x10(%rsp), %rax
movq %rcx, 0x40(%rax)
addq $0x18, %rsp
retq
nopw %cs:(%rax,%rax)
// File: tomfunkhouser[P]gaps/pkgs/R3Shapes/ply.cpp
// Function: write_ascii_item(_IO_FILE*, int, unsigned int, double, int)
void write_ascii_item(
  FILE *fp,
  int int_val,
  unsigned int uint_val,
  double double_val,
  int type
)
{
  switch (type) {
    case PLY_CHAR:
    case PLY_SHORT:
    case PLY_INT:
      fprintf (fp, "%d ", int_val);
      break;
    case PLY_UCHAR:
    case PLY_USHORT:
    case PLY_UINT:
      fprintf (fp, "%u ", uint_val);
      break;
    case PLY_FLOAT:
    case PLY_DOUBLE:
      fprintf (fp, "%g ", double_val);
      break;
    default:
      fprintf (stderr, "write_ascii_item: bad type = %d\n", type);
      exit (-1);
  }
}

// Assembly:
subq $0x28, %rsp
movq %rdi, 0x20(%rsp)
movl %esi, 0x1c(%rsp)
movl %edx, 0x18(%rsp)
movsd %xmm0, 0x10(%rsp)
movl %ecx, 0xc(%rsp)
movl 0xc(%rsp), %eax
movl %eax, 0x8(%rsp)
decl %eax
subl $0x3, %eax
jb 0x72998
jmp 0x7297c
movl 0x8(%rsp), %eax
addl $-0x4, %eax
subl $0x3, %eax
jb 0x729b1
jmp 0x7298a
movl 0x8(%rsp), %eax
addl $-0x7, %eax
subl $0x2, %eax
jb 0x729ca
jmp 0x729e5
movq 0x20(%rsp), %rdi
movl 0x1c(%rsp), %edx
leaq 0xc2e99(%rip), %rsi     # 0x135841
movb $0x0, %al
callq 0xf730
jmp 0x72a0b
movq 0x20(%rsp), %rdi
movl 0x18(%rsp), %edx
leaq 0xc2e84(%rip), %rsi     # 0x135845
movb $0x0, %al
callq 0xf730
jmp 0x72a0b
movq 0x20(%rsp), %rdi
movsd 0x10(%rsp), %xmm0
leaq 0xc26a5(%rip), %rsi     # 0x135081
movb $0x1, %al
callq 0xf730
jmp 0x72a0b
movq 0xfc5dc(%rip), %rax     # 0x16efc8
movq (%rax), %rdi
movl 0xc(%rsp), %edx
leaq 0xc2e53(%rip), %rsi     # 0x13584d
movb $0x0, %al
callq 0xf730
movl $0xffffffff, %edi       # imm = 0xFFFFFFFF
callq 0xf600
addq $0x28, %rsp
retq
// File: 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 $0x48, %rsp
movq %rdi, 0x40(%rsp)
movl %esi, 0x3c(%rsp)
movl %edx, 0x38(%rsp)
movl %ecx, 0x34(%rsp)
movsd %xmm0, 0x28(%rsp)
movl %r8d, 0x24(%rsp)
movl 0x24(%rsp), %eax
decl %eax
movl %eax, %ecx
movq %rcx, 0x8(%rsp)
subl $0x7, %eax
ja 0x72af6
movq 0x8(%rsp), %rax
leaq 0xc27d6(%rip), %rcx     # 0x135228
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movl 0x38(%rsp), %eax
movb %al, 0x22(%rsp)
leaq 0x22(%rsp), %rax
movq %rax, 0x10(%rsp)
jmp 0x72b1c
movl 0x38(%rsp), %eax
movw %ax, 0x1e(%rsp)
leaq 0x1e(%rsp), %rax
movq %rax, 0x10(%rsp)
jmp 0x72b1c
leaq 0x38(%rsp), %rax
movq %rax, 0x10(%rsp)
jmp 0x72b1c
movl 0x34(%rsp), %eax
movb %al, 0x23(%rsp)
leaq 0x23(%rsp), %rax
movq %rax, 0x10(%rsp)
jmp 0x72b1c
movl 0x34(%rsp), %eax
movw %ax, 0x20(%rsp)
leaq 0x20(%rsp), %rax
movq %rax, 0x10(%rsp)
jmp 0x72b1c
leaq 0x34(%rsp), %rax
movq %rax, 0x10(%rsp)
jmp 0x72b1c
movsd 0x28(%rsp), %xmm0
cvtsd2ss %xmm0, %xmm0
movss %xmm0, 0x18(%rsp)
leaq 0x18(%rsp), %rax
movq %rax, 0x10(%rsp)
jmp 0x72b1c
leaq 0x28(%rsp), %rax
movq %rax, 0x10(%rsp)
jmp 0x72b1c
movq 0xfc4cb(%rip), %rax     # 0x16efc8
movq (%rax), %rdi
movl 0x24(%rsp), %edx
leaq 0xc2d14(%rip), %rsi     # 0x13581f
movb $0x0, %al
callq 0xf730
movl $0xffffffff, %edi       # imm = 0xFFFFFFFF
callq 0xf600
movl 0x3c(%rsp), %eax
cmpl 0x1057de(%rip), %eax    # 0x178304
je 0x72b53
movslq 0x24(%rsp), %rcx
leaq 0x1057ac(%rip), %rax    # 0x1782e0
cmpl $0x1, (%rax,%rcx,4)
jle 0x72b53
movq 0x10(%rsp), %rdi
movslq 0x24(%rsp), %rcx
leaq 0x105795(%rip), %rax    # 0x1782e0
movl (%rax,%rcx,4), %esi
callq 0x75510
movq 0x10(%rsp), %rdi
movslq 0x24(%rsp), %rcx
leaq 0x10577c(%rip), %rax    # 0x1782e0
movslq (%rax,%rcx,4), %rsi
movq 0x40(%rsp), %rcx
movl $0x1, %edx
callq 0xf980
addq $0x48, %rsp
retq
nopl (%rax)
// File: 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:
subq $0x18, %rsp
movq %rdi, 0x10(%rsp)
movq %rsi, 0x8(%rsp)
movq 0x10(%rsp), %rax
cmpl $0x0, 0x20(%rax)
jne 0x72bbd
movl $0x8, %edi
movl $0x294, %esi            # imm = 0x294
leaq 0xc2745(%rip), %rdx     # 0x1352ef
callq 0x71630
movq %rax, %rcx
movq 0x10(%rsp), %rax
movq %rcx, 0x28(%rax)
jmp 0x72be9
movq 0x10(%rsp), %rax
movq 0x28(%rax), %rdi
movq 0x10(%rsp), %rax
movl 0x20(%rax), %eax
addl $0x1, %eax
movslq %eax, %rsi
shlq $0x3, %rsi
callq 0xf850
movq %rax, %rcx
movq 0x10(%rsp), %rax
movq %rcx, 0x28(%rax)
movq 0x8(%rsp), %rdi
callq 0x71680
movq %rax, %rdx
movq 0x10(%rsp), %rax
movq 0x28(%rax), %rax
movq 0x10(%rsp), %rcx
movslq 0x20(%rcx), %rcx
movq %rdx, (%rax,%rcx,8)
movq 0x10(%rsp), %rax
movl 0x20(%rax), %ecx
addl $0x1, %ecx
movl %ecx, 0x20(%rax)
addq $0x18, %rsp
retq
nop
// File: 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:
subq $0x18, %rsp
movq %rdi, 0x10(%rsp)
movq %rsi, 0x8(%rsp)
movq 0x10(%rsp), %rax
cmpl $0x0, 0x30(%rax)
jne 0x72c5d
movl $0x8, %edi
movl $0x2ac, %esi            # imm = 0x2AC
leaq 0xc26a5(%rip), %rdx     # 0x1352ef
callq 0x71630
movq %rax, %rcx
movq 0x10(%rsp), %rax
movq %rcx, 0x38(%rax)
jmp 0x72c89
movq 0x10(%rsp), %rax
movq 0x38(%rax), %rdi
movq 0x10(%rsp), %rax
movl 0x30(%rax), %eax
addl $0x1, %eax
movslq %eax, %rsi
shlq $0x3, %rsi
callq 0xf850
movq %rax, %rcx
movq 0x10(%rsp), %rax
movq %rcx, 0x38(%rax)
movq 0x8(%rsp), %rdi
callq 0x71680
movq %rax, %rdx
movq 0x10(%rsp), %rax
movq 0x38(%rax), %rax
movq 0x10(%rsp), %rcx
movslq 0x30(%rcx), %rcx
movq %rdx, (%rax,%rcx,8)
movq 0x10(%rsp), %rax
movl 0x30(%rax), %ecx
addl $0x1, %ecx
movl %ecx, 0x30(%rax)
addq $0x18, %rsp
retq
nop
// File: tomfunkhouser[P]gaps/pkgs/R3Shapes/ply.cpp
// Function: equal_strings
int equal_strings(const char *s1, const char *s2)
{

  while (*s1 && *s2)
    if (*s1++ != *s2++)
      return (0);

  if (*s1 != *s2)
    return (0);
  else
    return (1);
}

// Assembly:
movq %rdi, -0x10(%rsp)
movq %rsi, -0x18(%rsp)
movq -0x10(%rsp), %rcx
xorl %eax, %eax
cmpb $0x0, (%rcx)
movb %al, -0x19(%rsp)
je 0x734d9
movq -0x18(%rsp), %rax
cmpb $0x0, (%rax)
setne %al
movb %al, -0x19(%rsp)
movb -0x19(%rsp), %al
testb $0x1, %al
jne 0x734e3
jmp 0x7351b
movq -0x10(%rsp), %rax
movq %rax, %rcx
addq $0x1, %rcx
movq %rcx, -0x10(%rsp)
movsbl (%rax), %eax
movq -0x18(%rsp), %rcx
movq %rcx, %rdx
addq $0x1, %rdx
movq %rdx, -0x18(%rsp)
movsbl (%rcx), %ecx
cmpl %ecx, %eax
je 0x73519
movl $0x0, -0x4(%rsp)
jmp 0x73541
jmp 0x734ba
movq -0x10(%rsp), %rax
movsbl (%rax), %eax
movq -0x18(%rsp), %rcx
movsbl (%rcx), %ecx
cmpl %ecx, %eax
je 0x73539
movl $0x0, -0x4(%rsp)
jmp 0x73541
movl $0x1, -0x4(%rsp)
movl -0x4(%rsp), %eax
retq
nopw %cs:(%rax,%rax)
// File: 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:
subq $0x18, %rsp
movq %rdi, 0x10(%rsp)
movq %rsi, 0x8(%rsp)
movl $0x30, %edi
movl $0xa00, %esi            # imm = 0xA00
leaq 0xc1d80(%rip), %rdx     # 0x1352ef
callq 0x71630
movq %rax, (%rsp)
movq 0x8(%rsp), %rax
movq 0x8(%rax), %rdi
callq 0x71680
movq %rax, %rcx
movq (%rsp), %rax
movq %rcx, (%rax)
movq 0x8(%rsp), %rax
movq 0x10(%rax), %rdi
callq 0xf7b0
movl %eax, %ecx
movq (%rsp), %rax
movl %ecx, 0x8(%rax)
movq (%rsp), %rax
movl $0x0, 0x10(%rax)
movq 0x10(%rsp), %rax
cmpl $0x0, 0x10(%rax)
jne 0x735e1
movl $0x8, %edi
movl $0xa07, %esi            # imm = 0xA07
leaq 0xc1d21(%rip), %rdx     # 0x1352ef
callq 0x71630
movq %rax, %rcx
movq 0x10(%rsp), %rax
movq %rcx, 0x18(%rax)
jmp 0x7360d
movq 0x10(%rsp), %rax
movq 0x18(%rax), %rdi
movq 0x10(%rsp), %rax
movl 0x10(%rax), %eax
addl $0x1, %eax
movslq %eax, %rsi
shlq $0x3, %rsi
callq 0xf850
movq %rax, %rcx
movq 0x10(%rsp), %rax
movq %rcx, 0x18(%rax)
movq (%rsp), %rdx
movq 0x10(%rsp), %rax
movq 0x18(%rax), %rax
movq 0x10(%rsp), %rcx
movslq 0x10(%rcx), %rcx
movq %rdx, (%rax,%rcx,8)
movq 0x10(%rsp), %rax
movl 0x10(%rax), %ecx
addl $0x1, %ecx
movl %ecx, 0x10(%rax)
addq $0x18, %rsp
retq
nopw (%rax,%rax)
// File: 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:
subq $0x28, %rsp
movq %rdi, 0x20(%rsp)
movq %rsi, 0x18(%rsp)
movl $0x28, %edi
movl $0xa44, %esi            # imm = 0xA44
leaq 0xc1c90(%rip), %rdx     # 0x1352ef
callq 0x71630
movq %rax, 0x10(%rsp)
movq 0x18(%rsp), %rax
movq 0x8(%rax), %rdi
leaq 0xc2298(%rip), %rsi     # 0x135911
callq 0x734b0
cmpl $0x0, %eax
je 0x736da
movq 0x18(%rsp), %rax
movq 0x10(%rax), %rdi
callq 0x759c0
movl %eax, %ecx
movq 0x10(%rsp), %rax
movl %ecx, 0x18(%rax)
movq 0x18(%rsp), %rax
movq 0x18(%rax), %rdi
callq 0x759c0
movl %eax, %ecx
movq 0x10(%rsp), %rax
movl %ecx, 0x8(%rax)
movq 0x18(%rsp), %rax
movq 0x20(%rax), %rdi
callq 0x71680
movq %rax, %rcx
movq 0x10(%rsp), %rax
movq %rcx, (%rax)
movq 0x10(%rsp), %rax
movl $0x1, 0x14(%rax)
jmp 0x73717
movq 0x18(%rsp), %rax
movq 0x8(%rax), %rdi
callq 0x759c0
movl %eax, %ecx
movq 0x10(%rsp), %rax
movl %ecx, 0x8(%rax)
movq 0x18(%rsp), %rax
movq 0x10(%rax), %rdi
callq 0x71680
movq %rax, %rcx
movq 0x10(%rsp), %rax
movq %rcx, (%rax)
movq 0x10(%rsp), %rax
movl $0x0, 0x14(%rax)
movq 0x20(%rsp), %rax
movq 0x18(%rax), %rax
movq 0x20(%rsp), %rcx
movl 0x10(%rcx), %ecx
subl $0x1, %ecx
movslq %ecx, %rcx
movq (%rax,%rcx,8), %rax
movq %rax, 0x8(%rsp)
movq 0x8(%rsp), %rax
cmpl $0x0, 0x10(%rax)
jne 0x73766
movl $0x8, %edi
movl $0xa57, %esi            # imm = 0xA57
leaq 0xc1b9c(%rip), %rdx     # 0x1352ef
callq 0x71630
movq %rax, %rcx
movq 0x8(%rsp), %rax
movq %rcx, 0x18(%rax)
jmp 0x73792
movq 0x8(%rsp), %rax
movq 0x18(%rax), %rdi
movq 0x8(%rsp), %rax
movl 0x10(%rax), %eax
addl $0x1, %eax
movslq %eax, %rsi
shlq $0x3, %rsi
callq 0xf850
movq %rax, %rcx
movq 0x8(%rsp), %rax
movq %rcx, 0x18(%rax)
movq 0x10(%rsp), %rdx
movq 0x8(%rsp), %rax
movq 0x18(%rax), %rax
movq 0x8(%rsp), %rcx
movslq 0x10(%rcx), %rcx
movq %rdx, (%rax,%rcx,8)
movq 0x8(%rsp), %rax
movl 0x10(%rax), %ecx
addl $0x1, %ecx
movl %ecx, 0x10(%rax)
addq $0x28, %rsp
retq
// File: tomfunkhouser[P]gaps/pkgs/R3Shapes/ply.cpp
// Function: add_comment(PlyFile*, char*)
void add_comment (PlyFile *plyfile, char *line)
{
  int i;

  /* skip over "comment" and leading spaces and tabs */
  i = 7;
  while (line[i] == ' ' || line[i] == '\t')
    i++;

  ply_put_comment (plyfile, &line[i]);
}

// Assembly:
subq $0x18, %rsp
movq %rdi, 0x10(%rsp)
movq %rsi, 0x8(%rsp)
movl $0x7, 0x4(%rsp)
movq 0x8(%rsp), %rax
movslq 0x4(%rsp), %rcx
movsbl (%rax,%rcx), %ecx
movb $0x1, %al
cmpl $0x20, %ecx
movb %al, 0x3(%rsp)
je 0x73807
movq 0x8(%rsp), %rax
movslq 0x4(%rsp), %rcx
movsbl (%rax,%rcx), %eax
cmpl $0x9, %eax
sete %al
movb %al, 0x3(%rsp)
movb 0x3(%rsp), %al
testb $0x1, %al
jne 0x73811
jmp 0x7381e
movl 0x4(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x4(%rsp)
jmp 0x737d6
movq 0x10(%rsp), %rdi
movq 0x8(%rsp), %rsi
movslq 0x4(%rsp), %rax
addq %rax, %rsi
callq 0x72b80
addq $0x18, %rsp
retq
nopw (%rax,%rax)
// File: tomfunkhouser[P]gaps/pkgs/R3Shapes/ply.cpp
// Function: add_obj_info(PlyFile*, char*)
void add_obj_info (PlyFile *plyfile, char *line)
{
  int i;

  /* skip over "obj_info" and leading spaces and tabs */
  i = 8;
  while (line[i] == ' ' || line[i] == '\t')
    i++;

  ply_put_obj_info (plyfile, &line[i]);
}

// Assembly:
subq $0x18, %rsp
movq %rdi, 0x10(%rsp)
movq %rsi, 0x8(%rsp)
movl $0x8, 0x4(%rsp)
movq 0x8(%rsp), %rax
movslq 0x4(%rsp), %rcx
movsbl (%rax,%rcx), %ecx
movb $0x1, %al
cmpl $0x20, %ecx
movb %al, 0x3(%rsp)
je 0x73887
movq 0x8(%rsp), %rax
movslq 0x4(%rsp), %rcx
movsbl (%rax,%rcx), %eax
cmpl $0x9, %eax
sete %al
movb %al, 0x3(%rsp)
movb 0x3(%rsp), %al
testb $0x1, %al
jne 0x73891
jmp 0x7389e
movl 0x4(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x4(%rsp)
jmp 0x73856
movq 0x10(%rsp), %rdi
movq 0x8(%rsp), %rsi
movslq 0x4(%rsp), %rax
addq %rax, %rsi
callq 0x72c20
addq $0x18, %rsp
retq
nopw (%rax,%rax)
// File: 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:
subq $0x58, %rsp
movq %rdi, 0x48(%rsp)
movq %rsi, 0x40(%rsp)
movq %rdx, 0x38(%rsp)
movq %rcx, 0x30(%rsp)
movq %r8, 0x28(%rsp)
movq 0x48(%rsp), %rdi
callq 0xf200
addq $0x5, %rax
shlq $0x0, %rax
movl %eax, %edi
movl $0x365, %esi            # imm = 0x365
leaq 0xc19f2(%rip), %rdx     # 0x1352ef
callq 0x71630
movq %rax, 0x10(%rsp)
movq 0x10(%rsp), %rdi
movq 0x48(%rsp), %rsi
callq 0xf450
movq 0x10(%rsp), %rdi
callq 0xf200
cmpq $0x4, %rax
jb 0x73957
movq 0x10(%rsp), %rax
movq %rax, 0x8(%rsp)
movq 0x10(%rsp), %rdi
callq 0xf200
movq 0x8(%rsp), %rdi
addq %rax, %rdi
addq $-0x4, %rdi
leaq 0xbfa42(%rip), %rsi     # 0x13338f
callq 0xf700
cmpl $0x0, %eax
je 0x73968
movq 0x10(%rsp), %rdi
leaq 0xbfa2c(%rip), %rsi     # 0x13338f
callq 0xf8b0
movq 0x10(%rsp), %rdi
leaq 0xc4cff(%rip), %rsi     # 0x138673
callq 0xf5e0
movq %rax, 0x20(%rsp)
cmpq $0x0, 0x20(%rsp)
jne 0x73991
movq $0x0, 0x50(%rsp)
jmp 0x739d6
movq 0x20(%rsp), %rdi
movq 0x40(%rsp), %rsi
movq 0x38(%rsp), %rdx
callq 0x72cc0
movq %rax, 0x18(%rsp)
movq 0x18(%rsp), %rax
movl 0x8(%rax), %ecx
movq 0x30(%rsp), %rax
movl %ecx, (%rax)
movq 0x18(%rsp), %rax
movss 0xc(%rax), %xmm0
movq 0x28(%rsp), %rax
movss %xmm0, (%rax)
movq 0x18(%rsp), %rax
movq %rax, 0x50(%rsp)
movq 0x50(%rsp), %rax
addq $0x58, %rsp
retq
// File: 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:
subq $0x48, %rsp
movq %rdi, 0x38(%rsp)
movq %rsi, 0x30(%rsp)
movq %rdx, 0x28(%rsp)
movq %rcx, 0x20(%rsp)
movq 0x38(%rsp), %rdi
movq 0x30(%rsp), %rsi
callq 0x71970
movq %rax, 0x10(%rsp)
cmpq $0x0, 0x10(%rsp)
jne 0x73a22
movq $0x0, 0x40(%rsp)
jmp 0x73ad9
movq 0x10(%rsp), %rax
movl 0x8(%rax), %ecx
movq 0x28(%rsp), %rax
movl %ecx, (%rax)
movq 0x10(%rsp), %rax
movl 0x10(%rax), %ecx
movq 0x20(%rsp), %rax
movl %ecx, (%rax)
movq 0x10(%rsp), %rax
movslq 0x10(%rax), %rax
shlq $0x3, %rax
movl %eax, %edi
movl $0x3a2, %esi            # imm = 0x3A2
leaq 0xc1894(%rip), %rdx     # 0x1352ef
callq 0x71630
movq %rax, (%rsp)
movl $0x0, 0x1c(%rsp)
movl 0x1c(%rsp), %eax
movq 0x10(%rsp), %rcx
cmpl 0x10(%rcx), %eax
jge 0x73ad0
movl $0x28, %edi
movl $0x3a4, %esi            # imm = 0x3A4
leaq 0xc1864(%rip), %rdx     # 0x1352ef
callq 0x71630
movq %rax, 0x8(%rsp)
movq 0x8(%rsp), %rdi
movq 0x10(%rsp), %rax
movq 0x18(%rax), %rax
movslq 0x1c(%rsp), %rcx
movq (%rax,%rcx,8), %rsi
callq 0x71a00
movq 0x8(%rsp), %rdx
movq (%rsp), %rax
movslq 0x1c(%rsp), %rcx
movq %rdx, (%rax,%rcx,8)
movl 0x1c(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x1c(%rsp)
jmp 0x73a6c
movq (%rsp), %rax
movq %rax, 0x40(%rsp)
movq 0x40(%rsp), %rax
addq $0x48, %rsp
retq
nopw %cs:(%rax,%rax)
// File: 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:
subq $0x48, %rsp
movq %rdi, 0x40(%rsp)
movq %rsi, 0x38(%rsp)
movl %edx, 0x34(%rsp)
movq %rcx, 0x28(%rsp)
movq 0x40(%rsp), %rdi
movq 0x38(%rsp), %rsi
callq 0x71970
movq %rax, 0x18(%rsp)
movq 0x18(%rsp), %rcx
movq 0x40(%rsp), %rax
movq %rcx, 0x40(%rax)
movl $0x0, 0x24(%rsp)
movl 0x24(%rsp), %eax
cmpl 0x34(%rsp), %eax
jge 0x73c37
movq 0x18(%rsp), %rdi
movq 0x28(%rsp), %rax
movslq 0x24(%rsp), %rcx
imulq $0x28, %rcx, %rcx
addq %rcx, %rax
movq (%rax), %rsi
leaq 0xc(%rsp), %rdx
callq 0x73c40
movq %rax, 0x10(%rsp)
cmpq $0x0, 0x10(%rsp)
jne 0x73ba5
movq 0xfb452(%rip), %rax     # 0x16efc8
movq (%rax), %rdi
movq 0x28(%rsp), %rax
movslq 0x24(%rsp), %rcx
imulq $0x28, %rcx, %rcx
addq %rcx, %rax
movq (%rax), %rdx
movq 0x38(%rsp), %rcx
leaq 0xc1a7b(%rip), %rsi     # 0x135614
movb $0x0, %al
callq 0xf730
jmp 0x73c27
movq 0x28(%rsp), %rax
movslq 0x24(%rsp), %rcx
imulq $0x28, %rcx, %rcx
addq %rcx, %rax
movl 0xc(%rax), %ecx
movq 0x10(%rsp), %rax
movl %ecx, 0xc(%rax)
movq 0x28(%rsp), %rax
movslq 0x24(%rsp), %rcx
imulq $0x28, %rcx, %rcx
addq %rcx, %rax
movl 0x10(%rax), %ecx
movq 0x10(%rsp), %rax
movl %ecx, 0x10(%rax)
movq 0x28(%rsp), %rax
movslq 0x24(%rsp), %rcx
imulq $0x28, %rcx, %rcx
addq %rcx, %rax
movl 0x1c(%rax), %ecx
movq 0x10(%rsp), %rax
movl %ecx, 0x1c(%rax)
movq 0x28(%rsp), %rax
movslq 0x24(%rsp), %rcx
imulq $0x28, %rcx, %rcx
addq %rcx, %rax
movl 0x20(%rax), %ecx
movq 0x10(%rsp), %rax
movl %ecx, 0x20(%rax)
movq 0x18(%rsp), %rax
movq 0x20(%rax), %rax
movslq 0xc(%rsp), %rcx
movb $0x1, (%rax,%rcx)
movl 0x24(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x24(%rsp)
jmp 0x73b31
addq $0x48, %rsp
retq
nopl (%rax)
// File: 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:
subq $0x28, %rsp
movq %rdi, 0x18(%rsp)
movq %rsi, 0x10(%rsp)
movq %rdx, 0x8(%rsp)
movl $0x0, 0x4(%rsp)
movl 0x4(%rsp), %eax
movq 0x18(%rsp), %rcx
cmpl 0x10(%rcx), %eax
jge 0x73cc0
movq 0x10(%rsp), %rdi
movq 0x18(%rsp), %rax
movq 0x18(%rax), %rax
movslq 0x4(%rsp), %rcx
movq (%rax,%rcx,8), %rax
movq (%rax), %rsi
callq 0x734b0
cmpl $0x0, %eax
je 0x73cb1
movl 0x4(%rsp), %ecx
movq 0x8(%rsp), %rax
movl %ecx, (%rax)
movq 0x18(%rsp), %rax
movq 0x18(%rax), %rax
movslq 0x4(%rsp), %rcx
movq (%rax,%rcx,8), %rax
movq %rax, 0x20(%rsp)
jmp 0x73cd4
jmp 0x73cb3
movl 0x4(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x4(%rsp)
jmp 0x73c5b
movq 0x8(%rsp), %rax
movl $0xffffffff, (%rax)     # imm = 0xFFFFFFFF
movq $0x0, 0x20(%rsp)
movq 0x20(%rsp), %rax
addq $0x28, %rsp
retq
nop
// File: 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:
subq $0x38, %rsp
movq %rdi, 0x30(%rsp)
movq %rsi, 0x28(%rsp)
movq %rdx, 0x20(%rsp)
movq 0x30(%rsp), %rdi
movq 0x28(%rsp), %rsi
callq 0x71970
movq %rax, 0x18(%rsp)
movq 0x18(%rsp), %rcx
movq 0x30(%rsp), %rax
movq %rcx, 0x40(%rax)
movq 0x18(%rsp), %rdi
movq 0x20(%rsp), %rax
movq (%rax), %rsi
leaq 0xc(%rsp), %rdx
callq 0x73c40
movq %rax, 0x10(%rsp)
cmpq $0x0, 0x10(%rsp)
jne 0x73d60
movq 0xfb288(%rip), %rax     # 0x16efc8
movq (%rax), %rdi
movq 0x20(%rsp), %rax
movq (%rax), %rdx
movq 0x28(%rsp), %rcx
leaq 0xc18bd(%rip), %rsi     # 0x135614
movb $0x0, %al
callq 0xf730
jmp 0x73db2
movq 0x20(%rsp), %rax
movl 0xc(%rax), %ecx
movq 0x10(%rsp), %rax
movl %ecx, 0xc(%rax)
movq 0x20(%rsp), %rax
movl 0x10(%rax), %ecx
movq 0x10(%rsp), %rax
movl %ecx, 0x10(%rax)
movq 0x20(%rsp), %rax
movl 0x1c(%rax), %ecx
movq 0x10(%rsp), %rax
movl %ecx, 0x1c(%rax)
movq 0x20(%rsp), %rax
movl 0x20(%rax), %ecx
movq 0x10(%rsp), %rax
movl %ecx, 0x20(%rax)
movq 0x18(%rsp), %rax
movq 0x20(%rax), %rax
movslq 0xc(%rsp), %rcx
movb $0x1, (%rax,%rcx)
addq $0x38, %rsp
retq
nopw (%rax,%rax)
// File: 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:
subq $0x18, %rsp
movq %rdi, 0x10(%rsp)
movq 0x10(%rsp), %rax
cmpq $0x0, 0x48(%rax)
jne 0x74dda
jmp 0x74e70
movl $0x0, 0xc(%rsp)
movl 0xc(%rsp), %eax
movq 0x10(%rsp), %rcx
movq 0x48(%rcx), %rcx
cmpl (%rcx), %eax
jge 0x74e70
movq 0x10(%rsp), %rax
movq 0x48(%rax), %rax
movq 0x8(%rax), %rax
movslq 0xc(%rsp), %rcx
shlq $0x5, %rcx
addq %rcx, %rax
movq %rax, (%rsp)
movq 0x10(%rsp), %rdi
movq (%rsp), %rax
movq (%rax), %rsi
callq 0x721b0
movl $0x0, 0x8(%rsp)
movl 0x8(%rsp), %eax
movq (%rsp), %rcx
cmpl 0x8(%rcx), %eax
jge 0x74e5e
movq 0x10(%rsp), %rdi
movq (%rsp), %rax
movq 0x10(%rax), %rax
movslq 0x8(%rsp), %rcx
movq (%rax,%rcx,8), %rsi
callq 0x72220
movl 0x8(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x8(%rsp)
jmp 0x74e29
jmp 0x74e60
movl 0xc(%rsp), %eax
addl $0x1, %eax
movl %eax, 0xc(%rsp)
jmp 0x74de2
addq $0x18, %rsp
retq
nopw %cs:(%rax,%rax)
// File: tomfunkhouser[P]gaps/pkgs/R3Shapes/ply.cpp
// Function: ply_get_info
void ply_get_info(PlyFile *ply, float *version, int *file_type)
{
  if (ply == NULL)
    return;

  *version = ply->version;
  *file_type = ply->file_type;
}

// Assembly:
movq %rdi, -0x8(%rsp)
movq %rsi, -0x10(%rsp)
movq %rdx, -0x18(%rsp)
cmpq $0x0, -0x8(%rsp)
jne 0x74ed9
jmp 0x74efb
movq -0x8(%rsp), %rax
movss 0xc(%rax), %xmm0
movq -0x10(%rsp), %rax
movss %xmm0, (%rax)
movq -0x8(%rsp), %rax
movl 0x8(%rax), %ecx
movq -0x18(%rsp), %rax
movl %ecx, (%rax)
retq
nopl (%rax)
// File: 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:
subq $0x38, %rsp
movq %rdi, 0x30(%rsp)
movl %esi, 0x2c(%rsp)
movq %rdx, 0x20(%rsp)
movq %rcx, 0x18(%rsp)
movq %r8, 0x10(%rsp)
movl 0x2c(%rsp), %eax
movl %eax, 0xc(%rsp)
decl %eax
subl $0x5, %eax
jb 0x74f4d
jmp 0x74f2d
movl 0xc(%rsp), %eax
subl $0x6, %eax
je 0x74fa1
jmp 0x74f38
movl 0xc(%rsp), %eax
addl $-0x7, %eax
subl $0x2, %eax
jb 0x74fe5
jmp 0x7503f
movq 0x30(%rsp), %rdi
callq 0xf7b0
movl %eax, %ecx
movq 0x20(%rsp), %rax
movl %ecx, (%rax)
movq 0x20(%rsp), %rax
cmpl $0x0, (%rax)
jl 0x74f77
movq 0x20(%rsp), %rax
movl (%rax), %eax
movl %eax, 0x8(%rsp)
jmp 0x74f7f
xorl %eax, %eax
movl %eax, 0x8(%rsp)
jmp 0x74f7f
movl 0x8(%rsp), %ecx
movq 0x18(%rsp), %rax
movl %ecx, (%rax)
movq 0x20(%rsp), %rax
cvtsi2sdl (%rax), %xmm0
movq 0x10(%rsp), %rax
movsd %xmm0, (%rax)
jmp 0x75065
movq 0x30(%rsp), %rdi
xorl %eax, %eax
movl %eax, %esi
movl $0xa, %edx
callq 0xf710
movl %eax, %ecx
movq 0x18(%rsp), %rax
movl %ecx, (%rax)
movq 0x18(%rsp), %rax
movl (%rax), %ecx
movq 0x20(%rsp), %rax
movl %ecx, (%rax)
movq 0x18(%rsp), %rax
movl (%rax), %eax
cvtsi2sd %rax, %xmm0
movq 0x10(%rsp), %rax
movsd %xmm0, (%rax)
jmp 0x75065
movq 0x30(%rsp), %rdi
callq 0xf640
movq 0x10(%rsp), %rax
movsd %xmm0, (%rax)
movq 0x10(%rsp), %rax
cvttsd2si (%rax), %ecx
movq 0x20(%rsp), %rax
movl %ecx, (%rax)
movq 0x10(%rsp), %rax
movsd (%rax), %xmm0
xorps %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jb 0x7502a
movq 0x10(%rsp), %rax
cvttsd2si (%rax), %rax
movl %eax, 0x4(%rsp)
jmp 0x75032
xorl %eax, %eax
movl %eax, 0x4(%rsp)
jmp 0x75032
movl 0x4(%rsp), %ecx
movq 0x18(%rsp), %rax
movl %ecx, (%rax)
jmp 0x75065
movq 0xf9f82(%rip), %rax     # 0x16efc8
movq (%rax), %rdi
movl 0x2c(%rsp), %edx
leaq 0xc087d(%rip), %rsi     # 0x1358d1
movb $0x0, %al
callq 0xf730
movl $0xffffffff, %edi       # imm = 0xFFFFFFFF
callq 0xf600
addq $0x38, %rsp
retq
nopw (%rax,%rax)
// File: tomfunkhouser[P]gaps/pkgs/R3Shapes/ply.cpp
// Function: store_item(char*, int, int, unsigned int, double)
void store_item (
  char *item,
  int type,
  int int_val,
  unsigned int uint_val,
  double double_val
)
{
  unsigned char *puchar;
  short int *pshort;
  unsigned short int *pushort;
  int *pint;
  unsigned int *puint;
  float *pfloat;
  double *pdouble;

  switch (type) {
    case PLY_CHAR:
      *item = int_val;
      break;
    case PLY_UCHAR:
      puchar = (unsigned char *) item;
      *puchar = uint_val;
      break;
    case PLY_SHORT:
      pshort = (short *) item;
      *pshort = int_val;
      break;
    case PLY_USHORT:
      pushort = (unsigned short *) item;
      *pushort = uint_val;
      break;
    case PLY_INT:
      pint = (int *) item;
      *pint = int_val;
      break;
    case PLY_UINT:
      puint = (unsigned int *) item;
      *puint = uint_val;
      break;
    case PLY_FLOAT:
      pfloat = (float *) item;
      *pfloat = double_val;
      break;
    case PLY_DOUBLE:
      pdouble = (double *) item;
      *pdouble = double_val;
      break;
    default:
      fprintf (stderr, "store_item: bad type = %d\n", type);
      exit (-1);
  }
}

// Assembly:
subq $0x68, %rsp
movq %rdi, 0x60(%rsp)
movl %esi, 0x5c(%rsp)
movl %edx, 0x58(%rsp)
movl %ecx, 0x54(%rsp)
movsd %xmm0, 0x48(%rsp)
movl 0x5c(%rsp), %eax
decl %eax
movl %eax, %ecx
movq %rcx, 0x8(%rsp)
subl $0x7, %eax
ja 0x75188
movq 0x8(%rsp), %rax
leaq 0xc019b(%rip), %rcx     # 0x135248
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movl 0x58(%rsp), %eax
movb %al, %cl
movq 0x60(%rsp), %rax
movb %cl, (%rax)
jmp 0x751ae
movq 0x60(%rsp), %rax
movq %rax, 0x40(%rsp)
movl 0x54(%rsp), %eax
movb %al, %cl
movq 0x40(%rsp), %rax
movb %cl, (%rax)
jmp 0x751ae
movq 0x60(%rsp), %rax
movq %rax, 0x38(%rsp)
movl 0x58(%rsp), %eax
movw %ax, %cx
movq 0x38(%rsp), %rax
movw %cx, (%rax)
jmp 0x751ae
movq 0x60(%rsp), %rax
movq %rax, 0x30(%rsp)
movl 0x54(%rsp), %eax
movw %ax, %cx
movq 0x30(%rsp), %rax
movw %cx, (%rax)
jmp 0x751ae
movq 0x60(%rsp), %rax
movq %rax, 0x28(%rsp)
movl 0x58(%rsp), %ecx
movq 0x28(%rsp), %rax
movl %ecx, (%rax)
jmp 0x751ae
movq 0x60(%rsp), %rax
movq %rax, 0x20(%rsp)
movl 0x54(%rsp), %ecx
movq 0x20(%rsp), %rax
movl %ecx, (%rax)
jmp 0x751ae
movq 0x60(%rsp), %rax
movq %rax, 0x18(%rsp)
movsd 0x48(%rsp), %xmm0
cvtsd2ss %xmm0, %xmm0
movq 0x18(%rsp), %rax
movss %xmm0, (%rax)
jmp 0x751ae
movq 0x60(%rsp), %rax
movq %rax, 0x10(%rsp)
movsd 0x48(%rsp), %xmm0
movq 0x10(%rsp), %rax
movsd %xmm0, (%rax)
jmp 0x751ae
movq 0xf9e39(%rip), %rax     # 0x16efc8
movq (%rax), %rdi
movl 0x5c(%rsp), %edx
leaq 0xc0753(%rip), %rsi     # 0x1358f0
movb $0x0, %al
callq 0xf730
movl $0xffffffff, %edi       # imm = 0xFFFFFFFF
callq 0xf600
addq $0x68, %rsp
retq
nopw %cs:(%rax,%rax)
// File: 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:
movq %rdi, -0x8(%rsp)
movl %esi, -0xc(%rsp)
movl $0x0, -0x10(%rsp)
movl -0x10(%rsp), %eax
movl %eax, -0x18(%rsp)
movl -0xc(%rsp), %eax
movl $0x2, %ecx
cltd
idivl %ecx
movl %eax, %ecx
movl -0x18(%rsp), %eax
cmpl %ecx, %eax
jge 0x7559a
movq -0x8(%rsp), %rax
movslq -0x10(%rsp), %rcx
movb (%rax,%rcx), %al
movb %al, -0x11(%rsp)
movq -0x8(%rsp), %rax
movl -0xc(%rsp), %ecx
subl $0x1, %ecx
subl -0x10(%rsp), %ecx
movslq %ecx, %rcx
movb (%rax,%rcx), %dl
movq -0x8(%rsp), %rax
movslq -0x10(%rsp), %rcx
movb %dl, (%rax,%rcx)
movb -0x11(%rsp), %dl
movq -0x8(%rsp), %rax
movl -0xc(%rsp), %ecx
subl $0x1, %ecx
subl -0x10(%rsp), %ecx
movslq %ecx, %rcx
movb %dl, (%rax,%rcx)
movl -0x10(%rsp), %eax
addl $0x1, %eax
movl %eax, -0x10(%rsp)
jmp 0x75521
retq
nopl (%rax,%rax)
// File: 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:
subq $0x18, %rsp
movq %rdi, 0x8(%rsp)
movl $0x1, 0x4(%rsp)
cmpl $0x9, 0x4(%rsp)
jge 0x75a10
movq 0x8(%rsp), %rdi
movslq 0x4(%rsp), %rcx
leaq 0x1028a7(%rip), %rax    # 0x178290
movq (%rax,%rcx,8), %rsi
callq 0x734b0
cmpl $0x0, %eax
je 0x75a01
movl 0x4(%rsp), %eax
movl %eax, 0x14(%rsp)
jmp 0x75a5f
jmp 0x75a03
movl 0x4(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x4(%rsp)
jmp 0x759d1
movl $0x1, 0x4(%rsp)
cmpl $0x9, 0x4(%rsp)
jge 0x75a57
movq 0x8(%rsp), %rdi
movslq 0x4(%rsp), %rcx
leaq 0x1028e0(%rip), %rax    # 0x178310
movq (%rax,%rcx,8), %rsi
callq 0x734b0
cmpl $0x0, %eax
je 0x75a48
movl 0x4(%rsp), %eax
movl %eax, 0x14(%rsp)
jmp 0x75a5f
jmp 0x75a4a
movl 0x4(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x4(%rsp)
jmp 0x75a18
movl $0x0, 0x14(%rsp)
movl 0x14(%rsp), %eax
addq $0x18, %rsp
retq
nopl (%rax,%rax)