// File: /workspace/github_cpp_makefile_star2_O2/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 %r15
pushq %r14
pushq %r12
pushq %rbx
leaq 0x5b9b(%rip), %rax      # 0x9a60
movq %rax, (%rdi)
cmpl $0x2, 0x8(%rdx)
jle 0x4126
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
cmpq $0x4, %rcx
je 0x3f0f
xorl %edx, %edx
cmpq $0x4, %rdx
je 0x3f06
andl $0x0, -0x40(%rax,%rdx,4)
andl $0x0, (%rax,%rdx,4)
incq %rdx
jmp 0x3ef2
incq %rcx
addq $0x10, %rax
jmp 0x3eea
cmpl $0x2, %esi
je 0x3ff7
cmpl $0x1, %esi
jne 0x4143
movl $0x3f800000, %r12d      # imm = 0x3F800000
movl %r12d, 0x18(%rbx)
movl %r12d, 0x2c(%rbx)
movl %r12d, 0x40(%rbx)
movl %r12d, 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
pushq $0x1
popq %r15
movq %r14, %rdi
movl %r15d, %esi
callq *(%rax)
movss (%rax), %xmm0
movq 0x8(%rbx), %rax
movss %xmm0, 0x1c(%rax)
movq (%r14), %rax
pushq $0x2
popq %rbp
movq %r14, %rdi
movl %ebp, %esi
callq *(%rax)
movss (%rax), %xmm0
movq 0x8(%rbx), %rax
movss %xmm0, 0x2c(%rax)
movq 0x10(%rbx), %rax
movl %r12d, (%rax)
movl %r12d, 0x14(%rax)
movl %r12d, 0x28(%rax)
movl %r12d, 0x3c(%rax)
movq (%r14), %rax
movq %r14, %rdi
xorl %esi, %esi
callq *(%rax)
movss (%rax), %xmm0
xorps 0x2094(%rip), %xmm0     # 0x6040
movq 0x10(%rbx), %rax
movss %xmm0, 0xc(%rax)
movq (%r14), %rax
movq %r14, %rdi
movl %r15d, %esi
callq *(%rax)
movss (%rax), %xmm0
xorps 0x2075(%rip), %xmm0     # 0x6040
movq 0x10(%rbx), %rax
movss %xmm0, 0x1c(%rax)
movq (%r14), %rax
movq %r14, %rdi
movl %ebp, %esi
callq *(%rax)
movss (%rax), %xmm0
xorps 0x2057(%rip), %xmm0     # 0x6040
movq 0x10(%rbx), %rax
movss %xmm0, 0x2c(%rax)
jmp 0x4104
movq (%r14), %rax
movq %r14, %rdi
xorl %esi, %esi
callq *(%rax)
cvtss2sd (%rax), %xmm0
ucomisd 0x2053(%rip), %xmm0     # 0x6060
jbe 0x410d
movq (%r14), %rax
pushq $0x1
popq %rsi
movq %r14, %rdi
callq *(%rax)
cvtss2sd (%rax), %xmm0
ucomisd 0x2036(%rip), %xmm0     # 0x6060
jbe 0x410d
movq (%r14), %rax
pushq $0x2
popq %rsi
movq %r14, %rdi
callq *(%rax)
cvtss2sd (%rax), %xmm0
ucomisd 0x2019(%rip), %xmm0     # 0x6060
jbe 0x410d
movq (%r14), %rax
movq %r14, %rdi
xorl %esi, %esi
callq *(%rax)
movss (%rax), %xmm0
movq 0x8(%rbx), %rax
movss %xmm0, (%rax)
movq (%r14), %rax
pushq $0x1
popq %rbp
movq %r14, %rdi
movl %ebp, %esi
callq *(%rax)
movss (%rax), %xmm0
movq 0x8(%rbx), %rax
movss %xmm0, 0x14(%rax)
movq (%r14), %rax
pushq $0x2
popq %r15
movq %r14, %rdi
movl %r15d, %esi
callq *(%rax)
movss (%rax), %xmm0
movq 0x8(%rbx), %rax
movss %xmm0, 0x28(%rax)
movl $0x3f800000, %r12d      # imm = 0x3F800000
movl %r12d, 0x3c(%rax)
movq (%r14), %rax
movq %r14, %rdi
xorl %esi, %esi
callq *(%rax)
movss 0x1f4f(%rip), %xmm0     # 0x6004
divss (%rax), %xmm0
movq 0x10(%rbx), %rax
movss %xmm0, (%rax)
movq (%r14), %rax
movq %r14, %rdi
movl %ebp, %esi
callq *(%rax)
movss 0x1f31(%rip), %xmm0     # 0x6004
divss (%rax), %xmm0
movq 0x10(%rbx), %rax
movss %xmm0, 0x14(%rax)
movq (%r14), %rax
movq %r14, %rdi
movl %r15d, %esi
callq *(%rax)
movss 0x1f11(%rip), %xmm0     # 0x6004
divss (%rax), %xmm0
movq 0x10(%rbx), %rax
movss %xmm0, 0x28(%rax)
movl %r12d, 0x3c(%rax)
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
leaq 0x237e(%rip), %rdi      # 0x6492
leaq 0x22f9(%rip), %rsi      # 0x6414
leaq 0x234a(%rip), %rcx      # 0x646c
pushq $0x79
jmp 0x413d
leaq 0x2335(%rip), %rdi      # 0x6462
leaq 0x22e0(%rip), %rsi      # 0x6414
leaq 0x2331(%rip), %rcx      # 0x646c
pushq $0x5f
popq %rdx
callq 0x2070
leaq 0x2199(%rip), %rdi      # 0x62e3
leaq 0x22c3(%rip), %rsi      # 0x6414
leaq 0x2314(%rip), %rcx      # 0x646c
movl $0x84, %edx
callq 0x2070