// File: /workspace/github_cpp_makefile_star2_O1/BartMassey[P]ancient-raytracer/xform.cc
// Function: xform::xform(xform_types, float)
xform::xform( enum xform_types t, float a ) {
  int i, j;
  float ca = cos(a);
  float sa = sin(a);

#if DEBUGLEVEL > 0
  // check for small floating-point errors in trig functions
  assert( ca <= 1 );
  assert( ca >= -1 );
  assert( sa <= 1 );
  assert( ca >= -1 );
#endif
  // now generate the xform
  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_ROTATE_X:
    (*m)[0][0] = 1;
    (*m)[3][3] = 1;
    (*m)[1][1] = ca;
    (*m)[2][2] = ca;
    (*m)[1][2] = -sa;
    (*m)[2][1] = sa;
    (*mi)[0][0] = 1;
    (*mi)[3][3] = 1;
    (*mi)[1][1] = ca;
    (*mi)[2][2] = ca;
    (*mi)[1][2] = sa;
    (*mi)[2][1] = -sa;
    break;
  case XFORM_ROTATE_Y:
    (*m)[1][1] = 1;
    (*m)[3][3] = 1;
    (*m)[0][0] = ca;
    (*m)[2][2] = ca;
    (*m)[2][0] = -sa;
    (*m)[0][2] = sa;
    (*mi)[1][1] = 1;
    (*mi)[3][3] = 1;
    (*mi)[0][0] = ca;
    (*mi)[2][2] = ca;
    (*mi)[2][0] = sa;
    (*mi)[0][2] = -sa;
    break;
  case XFORM_ROTATE_Z:
    (*m)[2][2] = 1;
    (*m)[3][3] = 1;
    (*m)[0][0] = ca;
    (*m)[1][1] = ca;
    (*m)[0][1] = -sa;
    (*m)[1][0] = sa;
    (*mi)[2][2] = 1;
    (*mi)[3][3] = 1;
    (*mi)[0][0] = ca;
    (*mi)[1][1] = ca;
    (*mi)[0][1] = sa;
    (*mi)[1][0] = -sa;
    break;
  default:
    assert( 0 );
  }
}

// Assembly:
pushq %rbp
pushq %rbx
pushq %rax
movss %xmm0, 0x4(%rsp)
movl %esi, %ebp
movq %rdi, %rbx
leaq 0x8153(%rip), %rax      # 0xca60
movq %rax, (%rdi)
callq 0x2090
movss %xmm0, (%rsp)
movss 0x4(%rsp), %xmm0
callq 0x20c0
leaq 0x18(%rbx), %rax
movq %rax, 0x8(%rbx)
leaq 0x58(%rbx), %rax
movq %rax, 0x10(%rbx)
xorl %ecx, %ecx
xorl %edx, %edx
xorl %esi, %esi
movl %ecx, -0x40(%rax,%rsi,4)
movl %ecx, (%rax,%rsi,4)
incq %rsi
cmpq $0x4, %rsi
jne 0x493b
incq %rdx
addq $0x10, %rax
cmpq $0x4, %rdx
jne 0x4939
cmpl $0x5, %ebp
je 0x4a1a
cmpl $0x4, %ebp
je 0x49ca
cmpl $0x3, %ebp
jne 0x4a6f
movl $0x3f800000, %eax       # imm = 0x3F800000
movl %eax, 0x18(%rbx)
movabsq $0x3f8000003f800000, %rcx # imm = 0x3F8000003F800000
movq %rcx, 0x54(%rbx)
movss (%rsp), %xmm2
movss %xmm2, 0x2c(%rbx)
movss %xmm2, 0x40(%rbx)
movaps 0x4695(%rip), %xmm1     # 0x9030
xorps %xmm0, %xmm1
movss %xmm1, 0x30(%rbx)
movss %xmm0, 0x3c(%rbx)
movl %eax, 0x94(%rbx)
movss %xmm2, 0x6c(%rbx)
movss %xmm2, 0x80(%rbx)
movss %xmm0, 0x70(%rbx)
movss %xmm1, 0x7c(%rbx)
jmp 0x4a68
movl $0x3f800000, %eax       # imm = 0x3F800000
movl %eax, 0x2c(%rbx)
movl %eax, 0x54(%rbx)
movss (%rsp), %xmm2
movss %xmm2, 0x18(%rbx)
movss %xmm2, 0x40(%rbx)
movaps 0x4645(%rip), %xmm1     # 0x9030
xorps %xmm0, %xmm1
movss %xmm1, 0x38(%rbx)
movss %xmm0, 0x20(%rbx)
movl %eax, 0x6c(%rbx)
movl %eax, 0x94(%rbx)
movss %xmm2, 0x58(%rbx)
movss %xmm2, 0x80(%rbx)
movss %xmm0, 0x78(%rbx)
movss %xmm1, 0x60(%rbx)
jmp 0x4a68
movl $0x3f800000, %eax       # imm = 0x3F800000
movl %eax, 0x40(%rbx)
movl %eax, 0x54(%rbx)
movss (%rsp), %xmm2
movss %xmm2, 0x18(%rbx)
movss %xmm2, 0x2c(%rbx)
movaps 0x45f5(%rip), %xmm1     # 0x9030
xorps %xmm0, %xmm1
movss %xmm1, 0x1c(%rbx)
movss %xmm0, 0x28(%rbx)
movl %eax, 0x80(%rbx)
movl %eax, 0x94(%rbx)
movss %xmm2, 0x58(%rbx)
movss %xmm2, 0x6c(%rbx)
movss %xmm0, 0x5c(%rbx)
movss %xmm1, 0x68(%rbx)
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
leaq 0x484d(%rip), %rdi      # 0x92c3
leaq 0x4963(%rip), %rsi      # 0x93e0
leaq 0x4984(%rip), %rcx      # 0x9408
movl $0x58, %edx
callq 0x2080