// File: ingowald[P]closestSurfacePointQueries/src/distanceQueries.cpp
// Function: bvhlib::GeneralTriangleMesh<float, int, false>::getTriangle(unsigned long) const
inline Triangle GeneralTriangleMesh<coord_t,index_t,has_strides>::getTriangle(const size_t primID) const
  {
    Triangle t;
    if (has_strides) {
      const size_t i0 = this->idx_x[primID*idx_stride];
      const size_t i1 = this->idx_y[primID*idx_stride];
      const size_t i2 = this->idx_z[primID*idx_stride];
    
      t.v0 = vec3fa(this->vtx_x[i0*vtx_stride],
                    this->vtx_y[i0*vtx_stride],
                    this->vtx_z[i0*vtx_stride]);
      t.v1 = vec3fa(this->vtx_x[i1*vtx_stride],
                    this->vtx_y[i1*vtx_stride],
                    this->vtx_z[i1*vtx_stride]);
      t.v2 = vec3fa(this->vtx_x[i2*vtx_stride],
                    this->vtx_y[i2*vtx_stride],
                    this->vtx_z[i2*vtx_stride]);
    } else {
      const size_t i0 = this->idx_x[primID];
      const size_t i1 = this->idx_y[primID];
      const size_t i2 = this->idx_z[primID];
    
      t.v0 = vec3fa(this->vtx_x[i0],
                    this->vtx_y[i0],
                    this->vtx_z[i0]);
      t.v1 = vec3fa(this->vtx_x[i1],
                    this->vtx_y[i1],
                    this->vtx_z[i1]);
      t.v2 = vec3fa(this->vtx_x[i2],
                    this->vtx_y[i2],
                    this->vtx_z[i2]);
    }
    return t;
  }

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x80, %rsp
movq %rdi, -0x70(%rbp)
movq %rdi, %rax
movq %rax, -0x68(%rbp)
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x78(%rbp)
callq 0xa420
movq -0x78(%rbp), %rax
movq 0x68(%rax), %rcx
movq -0x18(%rbp), %rdx
movslq (%rcx,%rdx,4), %rcx
movq %rcx, -0x20(%rbp)
movq 0x70(%rax), %rcx
movq -0x18(%rbp), %rdx
movslq (%rcx,%rdx,4), %rcx
movq %rcx, -0x28(%rbp)
movq 0x78(%rax), %rcx
movq -0x18(%rbp), %rdx
movslq (%rcx,%rdx,4), %rcx
movq %rcx, -0x30(%rbp)
movq 0x48(%rax), %rcx
movq -0x20(%rbp), %rdx
movss (%rcx,%rdx,4), %xmm0
movq 0x50(%rax), %rcx
movq -0x20(%rbp), %rdx
movss (%rcx,%rdx,4), %xmm1
movq 0x58(%rax), %rax
movq -0x20(%rbp), %rcx
movss (%rax,%rcx,4), %xmm2
leaq -0x40(%rbp), %rdi
callq 0x9300
movq -0x78(%rbp), %rax
movq -0x70(%rbp), %rdi
movq -0x40(%rbp), %rcx
movq %rcx, (%rdi)
movq -0x38(%rbp), %rcx
movq %rcx, 0x8(%rdi)
movq 0x48(%rax), %rcx
movq -0x28(%rbp), %rdx
movss (%rcx,%rdx,4), %xmm0
movq 0x50(%rax), %rcx
movq -0x28(%rbp), %rdx
movss (%rcx,%rdx,4), %xmm1
movq 0x58(%rax), %rax
movq -0x28(%rbp), %rcx
movss (%rax,%rcx,4), %xmm2
leaq -0x50(%rbp), %rdi
callq 0x9300
movq -0x78(%rbp), %rax
movq -0x70(%rbp), %rdi
movq -0x50(%rbp), %rcx
movq %rcx, 0x10(%rdi)
movq -0x48(%rbp), %rcx
movq %rcx, 0x18(%rdi)
movq 0x48(%rax), %rcx
movq -0x30(%rbp), %rdx
movss (%rcx,%rdx,4), %xmm0
movq 0x50(%rax), %rcx
movq -0x30(%rbp), %rdx
movss (%rcx,%rdx,4), %xmm1
movq 0x58(%rax), %rax
movq -0x30(%rbp), %rcx
movss (%rax,%rcx,4), %xmm2
leaq -0x60(%rbp), %rdi
callq 0x9300
movq -0x70(%rbp), %rdi
movq -0x68(%rbp), %rax
movq -0x60(%rbp), %rcx
movq %rcx, 0x20(%rdi)
movq -0x58(%rbp), %rcx
movq %rcx, 0x28(%rdi)
addq $0x80, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
nopl (%rax)