// File: /workspace/github_cpp_makefile_star2_O3/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 0x7149(%rip), %rax      # 0xba60
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)
movq $-0x40, %rcx
xorps %xmm1, %xmm1
movups %xmm1, (%rax,%rcx)
movups %xmm1, 0x40(%rax,%rcx)
addq $0x10, %rcx
jne 0x4949
cmpl $0x5, %ebp
je 0x4a00
cmpl $0x4, %ebp
movss (%rsp), %xmm3
je 0x49bd
cmpl $0x3, %ebp
jne 0x4a63
movl $0x3f800000, %eax       # imm = 0x3F800000
movl %eax, 0x18(%rbx)
movss %xmm3, 0x2c(%rbx)
movss %xmm3, 0x40(%rbx)
movaps 0x36b3(%rip), %xmm1     # 0x8040
xorps %xmm0, %xmm1
movss %xmm1, 0x30(%rbx)
movss %xmm0, 0x3c(%rbx)
movsd 0x3a8e(%rip), %xmm2     # 0x8430
movsd %xmm2, 0x54(%rbx)
movl %eax, 0x94(%rbx)
leaq 0x6c(%rbx), %rax
movl $0x7c, %ecx
movl $0x70, %edx
jmp 0x49f9
movl $0x3f800000, %ecx       # imm = 0x3F800000
movl %ecx, 0x2c(%rbx)
movl %ecx, 0x54(%rbx)
movss %xmm3, 0x18(%rbx)
movss %xmm3, 0x40(%rbx)
movaps 0x3667(%rip), %xmm1     # 0x8040
xorps %xmm0, %xmm1
movss %xmm1, 0x38(%rbx)
movss %xmm0, 0x20(%rbx)
movl %ecx, 0x6c(%rbx)
movl %ecx, 0x94(%rbx)
movl $0x60, %ecx
movl $0x78, %edx
movl $0x80, %esi
jmp 0x4a49
movl $0x3f800000, %ecx       # imm = 0x3F800000
movl %ecx, 0x40(%rbx)
movl %ecx, 0x54(%rbx)
movss (%rsp), %xmm3
movss %xmm3, 0x18(%rbx)
movss %xmm3, 0x2c(%rbx)
movaps 0x361f(%rip), %xmm1     # 0x8040
xorps %xmm0, %xmm1
movss %xmm1, 0x1c(%rbx)
movss %xmm0, 0x28(%rbx)
movl %ecx, 0x80(%rbx)
movl %ecx, 0x94(%rbx)
movl $0x68, %ecx
movl $0x5c, %edx
movl $0x6c, %esi
movss %xmm3, (%rax)
movss %xmm3, (%rbx,%rsi)
movss %xmm0, (%rbx,%rdx)
movss %xmm1, (%rbx,%rcx)
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
leaq 0x3889(%rip), %rdi      # 0x82f3
leaq 0x39e3(%rip), %rsi      # 0x8454
leaq 0x3a04(%rip), %rcx      # 0x847c
movl $0x58, %edx
callq 0x2080