// File: /workspace/github_cpp_makefile_star2_O1/BartMassey[P]ancient-raytracer/xform.cc
// Function: xform::xform(xform_types, point)
xform::xform( enum xform_types t, point r ) {
  int i, j;

  assert( r.d() > 2 );
  m = &mv;
  mi = &miv;
  for( i = 0; i < 4; i++ )
    for( j = 0; j < 4; j++ ) {
      (*m)[i][j] = 0;
      (*mi)[i][j] = 0;
    }
  switch( t ) {
  case XFORM_TRANSLATE:
    (*m)[0][0] = 1;
    (*m)[1][1] = 1;
    (*m)[2][2] = 1;
    (*m)[3][3] = 1;
    (*m)[0][3] = r[0];
    (*m)[1][3] = r[1];
    (*m)[2][3] = r[2];
    (*mi)[0][0] = 1;
    (*mi)[1][1] = 1;
    (*mi)[2][2] = 1;
    (*mi)[3][3] = 1;
    (*mi)[0][3] = -r[0];
    (*mi)[1][3] = -r[1];
    (*mi)[2][3] = -r[2];
    break;
  case XFORM_SCALE:
    assert( r[0] > TINY && r[1] > TINY && r[2] > TINY );
    (*m)[0][0] = r[0];
    (*m)[1][1] = r[1];
    (*m)[2][2] = r[2];
    (*m)[3][3] = 1;
    (*mi)[0][0] = 1.0/r[0];
    (*mi)[1][1] = 1.0/r[1];
    (*mi)[2][2] = 1.0/r[2];
    (*mi)[3][3] = 1;
    break;
  default:
    assert( 0 );
  }
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
leaq 0x7fc7(%rip), %rax      # 0xca60
movq %rax, (%rdi)
cmpl $0x2, 0x8(%rdx)
jle 0x4cfc
movq %rdx, %r14
movq %rdi, %rbx
leaq 0x18(%rdi), %rax
movq %rax, 0x8(%rdi)
leaq 0x58(%rdi), %rax
movq %rax, 0x10(%rdi)
xorl %ecx, %ecx
xorl %edx, %edx
xorl %edi, %edi
movl %ecx, -0x40(%rax,%rdi,4)
movl %ecx, (%rax,%rdi,4)
incq %rdi
cmpq $0x4, %rdi
jne 0x4ac2
incq %rdx
addq $0x10, %rax
cmpq $0x4, %rdx
jne 0x4ac0
cmpl $0x2, %esi
je 0x4bc1
cmpl $0x1, %esi
jne 0x4d1b
movl $0x3f800000, %ebp       # imm = 0x3F800000
movl %ebp, 0x18(%rbx)
movl %ebp, 0x2c(%rbx)
movl %ebp, 0x40(%rbx)
movl %ebp, 0x54(%rbx)
movq (%r14), %rax
movq %r14, %rdi
xorl %esi, %esi
callq *(%rax)
movss (%rax), %xmm0
movq 0x8(%rbx), %rax
movss %xmm0, 0xc(%rax)
movq (%r14), %rax
movq %r14, %rdi
movl $0x1, %esi
callq *(%rax)
movss (%rax), %xmm0
movq 0x8(%rbx), %rax
movss %xmm0, 0x1c(%rax)
movq (%r14), %rax
movq %r14, %rdi
movl $0x2, %esi
callq *(%rax)
movss (%rax), %xmm0
movq 0x8(%rbx), %rax
movss %xmm0, 0x2c(%rax)
movq 0x10(%rbx), %rax
movl %ebp, (%rax)
movl %ebp, 0x14(%rax)
movl %ebp, 0x28(%rax)
movl %ebp, 0x3c(%rax)
movq (%r14), %rax
movq %r14, %rdi
xorl %esi, %esi
callq *(%rax)
movss (%rax), %xmm0
xorps 0x44bf(%rip), %xmm0     # 0x9030
movq 0x10(%rbx), %rax
movss %xmm0, 0xc(%rax)
movq (%r14), %rax
movq %r14, %rdi
movl $0x1, %esi
callq *(%rax)
movss (%rax), %xmm0
xorps 0x449e(%rip), %xmm0     # 0x9030
movq 0x10(%rbx), %rax
movss %xmm0, 0x1c(%rax)
movq (%r14), %rax
movq %r14, %rdi
movl $0x2, %esi
callq *(%rax)
movss (%rax), %xmm0
xorps 0x447d(%rip), %xmm0     # 0x9030
movq 0x10(%rbx), %rax
movss %xmm0, 0x2c(%rax)
jmp 0x4cd8
movq (%r14), %rax
movq %r14, %rdi
xorl %esi, %esi
callq *(%rax)
cvtss2sd (%rax), %xmm0
ucomisd 0x4449(%rip), %xmm0     # 0x9020
jbe 0x4cdd
movq (%r14), %rax
movq %r14, %rdi
movl $0x1, %esi
callq *(%rax)
xorps %xmm0, %xmm0
cvtss2sd (%rax), %xmm0
ucomisd 0x4427(%rip), %xmm0     # 0x9020
jbe 0x4cdd
movq (%r14), %rax
movq %r14, %rdi
movl $0x2, %esi
callq *(%rax)
xorps %xmm0, %xmm0
cvtss2sd (%rax), %xmm0
ucomisd 0x4405(%rip), %xmm0     # 0x9020
jbe 0x4cdd
movq (%r14), %rax
movq %r14, %rdi
xorl %esi, %esi
callq *(%rax)
movss (%rax), %xmm0
movq 0x8(%rbx), %rax
movss %xmm0, (%rax)
movq (%r14), %rax
movq %r14, %rdi
movl $0x1, %esi
callq *(%rax)
movss (%rax), %xmm0
movq 0x8(%rbx), %rax
movss %xmm0, 0x14(%rax)
movq (%r14), %rax
movq %r14, %rdi
movl $0x2, %esi
callq *(%rax)
movss (%rax), %xmm0
movq 0x8(%rbx), %rax
movss %xmm0, 0x28(%rax)
movl $0x3f800000, %ebp       # imm = 0x3F800000
movl %ebp, 0x3c(%rax)
movq (%r14), %rax
movq %r14, %rdi
xorl %esi, %esi
callq *(%rax)
movss 0x4383(%rip), %xmm0     # 0x9008
divss (%rax), %xmm0
movq 0x10(%rbx), %rax
movss %xmm0, (%rax)
movq (%r14), %rax
movq %r14, %rdi
movl $0x1, %esi
callq *(%rax)
movss 0x4362(%rip), %xmm0     # 0x9008
divss (%rax), %xmm0
movq 0x10(%rbx), %rax
movss %xmm0, 0x14(%rax)
movq (%r14), %rax
movq %r14, %rdi
movl $0x2, %esi
callq *(%rax)
movss 0x4340(%rip), %xmm0     # 0x9008
divss (%rax), %xmm0
movq 0x10(%rbx), %rax
movss %xmm0, 0x28(%rax)
movl %ebp, 0x3c(%rax)
popq %rbx
popq %r14
popq %rbp
retq
leaq 0x477a(%rip), %rdi      # 0x945e
leaq 0x46f5(%rip), %rsi      # 0x93e0
leaq 0x4746(%rip), %rcx      # 0x9438
movl $0x79, %edx
callq 0x2080
leaq 0x472b(%rip), %rdi      # 0x942e
leaq 0x46d6(%rip), %rsi      # 0x93e0
leaq 0x4727(%rip), %rcx      # 0x9438
movl $0x5f, %edx
callq 0x2080
leaq 0x45a1(%rip), %rdi      # 0x92c3
leaq 0x46b7(%rip), %rsi      # 0x93e0
leaq 0x4708(%rip), %rcx      # 0x9438
movl $0x84, %edx
callq 0x2080