// File: 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:
subq $0x28, %rsp
movq %rdi, 0x20(%rsp)
movq %rsi, 0x18(%rsp)
cmpq $0x0, 0x18(%rsp)
jne 0x74b6b
jmp 0x74db9
movq 0x18(%rsp), %rcx
movq 0x20(%rsp), %rax
movq %rcx, 0x48(%rax)
movq 0x20(%rsp), %rax
cmpl $0x0, 0x10(%rax)
jne 0x74bec
movq 0x20(%rsp), %rax
movl 0x10(%rax), %eax
movq 0x18(%rsp), %rcx
addl (%rcx), %eax
movl %eax, %eax
movl %eax, %edi
movl $0x8, %esi
callq 0xf320
movq %rax, %rcx
movq 0x20(%rsp), %rax
movq %rcx, 0x18(%rax)
movq 0x20(%rsp), %rax
cmpq $0x0, 0x18(%rax)
jne 0x74be7
movq 0xfa408(%rip), %rax     # 0x16efc8
movq (%rax), %rdi
leaq 0xc0ae1(%rip), %rsi     # 0x1356ab
movl $0x54c, %edx            # imm = 0x54C
leaq 0xc0719(%rip), %rcx     # 0x1352ef
movb $0x0, %al
callq 0xf730
movl $0xffffffff, %edi       # imm = 0xFFFFFFFF
callq 0xf600
jmp 0x74cf2
movq 0x20(%rsp), %rax
movq 0x18(%rax), %rdi
movq 0x20(%rsp), %rax
movl 0x10(%rax), %eax
movq 0x18(%rsp), %rcx
addl (%rcx), %eax
movslq %eax, %rsi
shlq $0x3, %rsi
callq 0xf850
movq %rax, %rcx
movq 0x20(%rsp), %rax
movq %rcx, 0x18(%rax)
movq 0x20(%rsp), %rax
cmpq $0x0, 0x18(%rax)
jne 0x74c99
movq 0x20(%rsp), %rax
movl 0x10(%rax), %eax
movq 0x18(%rsp), %rcx
addl (%rcx), %eax
cmpl $0x0, %eax
je 0x74c99
movq 0xfa385(%rip), %rax     # 0x16efc8
movq (%rax), %rdi
leaq 0xc0a89(%rip), %rsi     # 0x1356d6
movl $0x54c, %edx            # imm = 0x54C
leaq 0xc0696(%rip), %rcx     # 0x1352ef
movb $0x0, %al
callq 0xf730
movq 0xfa361(%rip), %rax     # 0x16efc8
movq (%rax), %rdi
movq 0x20(%rsp), %rax
movl 0x10(%rax), %edx
movq 0x20(%rsp), %rax
movl 0x10(%rax), %ecx
movq 0x18(%rsp), %rax
addl (%rax), %ecx
leaq 0xc0a7b(%rip), %rsi     # 0x135703
movb $0x0, %al
callq 0xf730
movl $0xffffffff, %edi       # imm = 0xFFFFFFFF
callq 0xf600
movq 0x20(%rsp), %rax
movl 0x10(%rax), %eax
movq 0x18(%rsp), %rcx
addl (%rcx), %eax
movq 0x20(%rsp), %rcx
cmpl 0x10(%rcx), %eax
jle 0x74cf0
movq 0x20(%rsp), %rax
movq 0x18(%rax), %rdi
movq 0x20(%rsp), %rax
movslq 0x10(%rax), %rax
shlq $0x3, %rax
addq %rax, %rdi
movq 0x20(%rsp), %rax
movl 0x10(%rax), %eax
movq 0x18(%rsp), %rcx
addl (%rcx), %eax
movq 0x20(%rsp), %rcx
subl 0x10(%rcx), %eax
movslq %eax, %rdx
shlq $0x3, %rdx
xorl %esi, %esi
callq 0xf280
jmp 0x74cf2
movl $0x0, 0x14(%rsp)
movl 0x14(%rsp), %eax
movq 0x18(%rsp), %rcx
cmpl (%rcx), %eax
jge 0x74db9
movq 0x18(%rsp), %rax
movq 0x8(%rax), %rax
movslq 0x14(%rsp), %rcx
shlq $0x5, %rcx
addq %rcx, %rax
movq %rax, 0x8(%rsp)
movl $0x30, %edi
movl $0x54f, %esi            # imm = 0x54F
leaq 0xc05b9(%rip), %rdx     # 0x1352ef
callq 0x71630
movq %rax, (%rsp)
movq (%rsp), %rdx
movq 0x20(%rsp), %rax
movq 0x18(%rax), %rax
movq 0x20(%rsp), %rsi
movl 0x10(%rsi), %ecx
movl %ecx, %edi
addl $0x1, %edi
movl %edi, 0x10(%rsi)
movslq %ecx, %rcx
movq %rdx, (%rax,%rcx,8)
movq 0x8(%rsp), %rax
movq (%rax), %rdi
callq 0x71680
movq %rax, %rcx
movq (%rsp), %rax
movq %rcx, (%rax)
movq 0x8(%rsp), %rax
movl 0x8(%rax), %ecx
movq (%rsp), %rax
movl %ecx, 0x8(%rax)
movq (%rsp), %rax
movl $0x0, 0x10(%rax)
movq 0x20(%rsp), %rdi
movq 0x8(%rsp), %rax
movq 0x18(%rax), %rsi
xorl %edx, %edx
callq 0x71c20
movl 0x14(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x14(%rsp)
jmp 0x74cfa
addq $0x28, %rsp
retq
nop