#define NULL ((void *)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t;
typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1

/* Forward declarations */

/* Type definitions */

/* Variables and functions */
double M_PI;
double cos(int);
double sin(int);
void rotate_cmt(double *M_cmt, double *N_cmt, double az) {
  double co, si, co2, si2;
  co = cos(az * M_PI / 180.);
  si = sin(az * M_PI / 180.);
  co2 = cos(2. * az * M_PI / 180.);
  si2 = sin(2. * az * M_PI / 180.);
  N_cmt[0] = M_cmt[0];
  N_cmt[1] = M_cmt[1] * co * co + M_cmt[2] * si * si - M_cmt[5] * si2;
  N_cmt[2] = M_cmt[2] * co * co + M_cmt[1] * si * si + M_cmt[5] * si2;
  N_cmt[3] = M_cmt[3] * co - M_cmt[4] * si;
  N_cmt[4] = M_cmt[3] * si + M_cmt[4] * co;
  N_cmt[5] = (M_cmt[1] - M_cmt[2]) * si2 / 2. + M_cmt[5] * co2;
}


x86 assembly (clang, -O0):
<rotate_cmt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
mov    0x2ea7(%rip),%rax
mulsd  (%rax),%xmm0
movsd  0xebb(%rip),%xmm1
divsd  %xmm1,%xmm0
cvttsd2si %xmm0,%edi
call   1040 <cos@plt>
movsd  %xmm0,-0x20(%rbp)
movsd  -0x18(%rbp),%xmm0
mov    0x2e7d(%rip),%rax
mulsd  (%rax),%xmm0
movsd  0xe91(%rip),%xmm1
divsd  %xmm1,%xmm0
cvttsd2si %xmm0,%edi
call   1030 <sin@plt>
movsd  %xmm0,-0x28(%rbp)
movsd  0xe6f(%rip),%xmm0
mulsd  -0x18(%rbp),%xmm0
mov    0x2e4b(%rip),%rax
mulsd  (%rax),%xmm0
movsd  0xe5f(%rip),%xmm1
divsd  %xmm1,%xmm0
cvttsd2si %xmm0,%edi
call   1040 <cos@plt>
movsd  %xmm0,-0x30(%rbp)
movsd  0xe3d(%rip),%xmm0
mulsd  -0x18(%rbp),%xmm0
mov    0x2e19(%rip),%rax
mulsd  (%rax),%xmm0
movsd  0xe2d(%rip),%xmm1
divsd  %xmm1,%xmm0
cvttsd2si %xmm0,%edi
call   1030 <sin@plt>
movsd  %xmm0,-0x38(%rbp)
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x10(%rbp),%rax
movsd  %xmm0,(%rax)
mov    -0x8(%rbp),%rax
movsd  0x8(%rax),%xmm1
mulsd  -0x20(%rbp),%xmm1
movsd  -0x20(%rbp),%xmm2
mov    -0x8(%rbp),%rax
movsd  0x10(%rax),%xmm0
mulsd  -0x28(%rbp),%xmm0
mulsd  -0x28(%rbp),%xmm0
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
mov    -0x8(%rbp),%rax
movsd  0x28(%rax),%xmm0
movsd  -0x38(%rbp),%xmm2
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
mov    -0x10(%rbp),%rax
movsd  %xmm0,0x8(%rax)
mov    -0x8(%rbp),%rax
movsd  0x10(%rax),%xmm1
mulsd  -0x20(%rbp),%xmm1
movsd  -0x20(%rbp),%xmm2
mov    -0x8(%rbp),%rax
movsd  0x8(%rax),%xmm0
mulsd  -0x28(%rbp),%xmm0
mulsd  -0x28(%rbp),%xmm0
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
mov    -0x8(%rbp),%rax
movsd  0x28(%rax),%xmm0
movsd  -0x38(%rbp),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
mov    -0x10(%rbp),%rax
movsd  %xmm0,0x10(%rax)
mov    -0x8(%rbp),%rax
movsd  0x18(%rax),%xmm0
movsd  -0x20(%rbp),%xmm2
mov    -0x8(%rbp),%rax
movsd  0x20(%rax),%xmm1
mulsd  -0x28(%rbp),%xmm1
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
mov    -0x10(%rbp),%rax
movsd  %xmm0,0x18(%rax)
mov    -0x8(%rbp),%rax
movsd  0x18(%rax),%xmm0
movsd  -0x28(%rbp),%xmm2
mov    -0x8(%rbp),%rax
movsd  0x20(%rax),%xmm1
mulsd  -0x20(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
mov    -0x10(%rbp),%rax
movsd  %xmm0,0x20(%rax)
mov    -0x8(%rbp),%rax
movsd  0x8(%rax),%xmm1
mov    -0x8(%rbp),%rax
subsd  0x10(%rax),%xmm1
mulsd  -0x38(%rbp),%xmm1
movsd  0xcc2(%rip),%xmm0
divsd  %xmm0,%xmm1
mov    -0x8(%rbp),%rax
movsd  0x28(%rax),%xmm0
movsd  -0x30(%rbp),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
mov    -0x10(%rbp),%rax
movsd  %xmm0,0x28(%rax)
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rotate_cmt>:
push   %r15
push   %r14
push   %rbx
sub    $0x20,%rsp
movsd  %xmm0,0x8(%rsp)
mov    %rsi,%r14
mov    %rdi,%rbx
mov    0x2eac(%rip),%r15
movsd  (%r15),%xmm1
mulsd  %xmm0,%xmm1
divsd  0xeb3(%rip),%xmm1
cvttsd2si %xmm1,%edi
call   1040 <cos@plt>
movsd  %xmm0,0x18(%rsp)
movsd  (%r15),%xmm0
mulsd  0x8(%rsp),%xmm0
divsd  0xe91(%rip),%xmm0
cvttsd2si %xmm0,%edi
call   1030 <sin@plt>
movsd  %xmm0,0x10(%rsp)
movsd  0x8(%rsp),%xmm1
addsd  %xmm1,%xmm1
movsd  %xmm1,0x8(%rsp)
movsd  (%r15),%xmm0
mulsd  %xmm1,%xmm0
divsd  0xe61(%rip),%xmm0
cvttsd2si %xmm0,%edi
call   1040 <cos@plt>
movsd  0x8(%rsp),%xmm1
mulsd  (%r15),%xmm1
movsd  %xmm0,0x8(%rsp)
divsd  0xe3f(%rip),%xmm1
cvttsd2si %xmm1,%edi
call   1030 <sin@plt>
movsd  (%rbx),%xmm1
movsd  %xmm1,(%r14)
movsd  0x8(%rbx),%xmm1
movsd  0x18(%rsp),%xmm3
mulsd  %xmm3,%xmm1
movsd  0x10(%rbx),%xmm2
movsd  0x10(%rsp),%xmm4
mulsd  %xmm4,%xmm2
mulsd  %xmm4,%xmm2
mulsd  %xmm3,%xmm1
addsd  %xmm2,%xmm1
movsd  0x28(%rbx),%xmm2
mulsd  %xmm0,%xmm2
subsd  %xmm2,%xmm1
movsd  %xmm1,0x8(%r14)
movsd  0x10(%rbx),%xmm1
mulsd  %xmm3,%xmm1
movsd  0x8(%rbx),%xmm2
mulsd  %xmm4,%xmm2
mulsd  %xmm4,%xmm2
mulsd  %xmm3,%xmm1
addsd  %xmm2,%xmm1
movsd  0x28(%rbx),%xmm2
mulsd  %xmm0,%xmm2
addsd  %xmm1,%xmm2
movsd  %xmm2,0x10(%r14)
movsd  0x20(%rbx),%xmm1
mulsd  %xmm4,%xmm1
movsd  0x18(%rbx),%xmm2
mulsd  %xmm3,%xmm2
subsd  %xmm1,%xmm2
movsd  %xmm2,0x18(%r14)
mulsd  0x20(%rbx),%xmm3
mulsd  0x18(%rbx),%xmm4
addsd  %xmm3,%xmm4
movsd  %xmm4,0x20(%r14)
movsd  0x8(%rbx),%xmm1
subsd  0x10(%rbx),%xmm1
mulsd  %xmm0,%xmm1
mulsd  0xd81(%rip),%xmm1
movsd  0x8(%rsp),%xmm0
mulsd  0x28(%rbx),%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,0x28(%r14)
add    $0x20,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@M_PI = global double 0.000000e+00
define void @rotate_cmt(double* %0, double* %1, double %2) {
%4 = alloca double*
%5 = alloca double*
%6 = alloca double
%7 = alloca double
%8 = alloca double
%9 = alloca double
%10 = alloca double
store double* %0, double** %4
store double* %1, double** %5
store double %2, double* %6
%11 = load double, double* %6
%12 = load double, double* @M_PI
%13 = fmul double %11, %12
%14 = fdiv double %13, 1.800000e+02
%15 = fptosi double %14 to i32
%16 = call double @cos(i32 %15)
store double %16, double* %7
%17 = load double, double* %6
%18 = load double, double* @M_PI
%19 = fmul double %17, %18
%20 = fdiv double %19, 1.800000e+02
%21 = fptosi double %20 to i32
%22 = call double @sin(i32 %21)
store double %22, double* %8
%23 = load double, double* %6
%24 = fmul double 2.000000e+00, %23
%25 = load double, double* @M_PI
%26 = fmul double %24, %25
%27 = fdiv double %26, 1.800000e+02
%28 = fptosi double %27 to i32
%29 = call double @cos(i32 %28)
store double %29, double* %9
%30 = load double, double* %6
%31 = fmul double 2.000000e+00, %30
%32 = load double, double* @M_PI
%33 = fmul double %31, %32
%34 = fdiv double %33, 1.800000e+02
%35 = fptosi double %34 to i32
%36 = call double @sin(i32 %35)
store double %36, double* %10
%37 = load double*, double** %4
%38 = getelementptr inbounds double, double* %37, i64 0
%39 = load double, double* %38
%40 = load double*, double** %5
%41 = getelementptr inbounds double, double* %40, i64 0
store double %39, double* %41
%42 = load double*, double** %4
%43 = getelementptr inbounds double, double* %42, i64 1
%44 = load double, double* %43
%45 = load double, double* %7
%46 = fmul double %44, %45
%47 = load double, double* %7
%48 = load double*, double** %4
%49 = getelementptr inbounds double, double* %48, i64 2
%50 = load double, double* %49
%51 = load double, double* %8
%52 = fmul double %50, %51
%53 = load double, double* %8
%54 = fmul double %52, %53
%55 = call double @llvm.fmuladd.f64(double %46, double %47, double %54)
%56 = load double*, double** %4
%57 = getelementptr inbounds double, double* %56, i64 5
%58 = load double, double* %57
%59 = load double, double* %10
%60 = fneg double %58
%61 = call double @llvm.fmuladd.f64(double %60, double %59, double %55)
%62 = load double*, double** %5
%63 = getelementptr inbounds double, double* %62, i64 1
store double %61, double* %63
%64 = load double*, double** %4
%65 = getelementptr inbounds double, double* %64, i64 2
%66 = load double, double* %65
%67 = load double, double* %7
%68 = fmul double %66, %67
%69 = load double, double* %7
%70 = load double*, double** %4
%71 = getelementptr inbounds double, double* %70, i64 1
%72 = load double, double* %71
%73 = load double, double* %8
%74 = fmul double %72, %73
%75 = load double, double* %8
%76 = fmul double %74, %75
%77 = call double @llvm.fmuladd.f64(double %68, double %69, double %76)
%78 = load double*, double** %4
%79 = getelementptr inbounds double, double* %78, i64 5
%80 = load double, double* %79
%81 = load double, double* %10
%82 = call double @llvm.fmuladd.f64(double %80, double %81, double %77)
%83 = load double*, double** %5
%84 = getelementptr inbounds double, double* %83, i64 2
store double %82, double* %84
%85 = load double*, double** %4
%86 = getelementptr inbounds double, double* %85, i64 3
%87 = load double, double* %86
%88 = load double, double* %7
%89 = load double*, double** %4
%90 = getelementptr inbounds double, double* %89, i64 4
%91 = load double, double* %90
%92 = load double, double* %8
%93 = fmul double %91, %92
%94 = fneg double %93
%95 = call double @llvm.fmuladd.f64(double %87, double %88, double %94)
%96 = load double*, double** %5
%97 = getelementptr inbounds double, double* %96, i64 3
store double %95, double* %97
%98 = load double*, double** %4
%99 = getelementptr inbounds double, double* %98, i64 3
%100 = load double, double* %99
%101 = load double, double* %8
%102 = load double*, double** %4
%103 = getelementptr inbounds double, double* %102, i64 4
%104 = load double, double* %103
%105 = load double, double* %7
%106 = fmul double %104, %105
%107 = call double @llvm.fmuladd.f64(double %100, double %101, double %106)
%108 = load double*, double** %5
%109 = getelementptr inbounds double, double* %108, i64 4
store double %107, double* %109
%110 = load double*, double** %4
%111 = getelementptr inbounds double, double* %110, i64 1
%112 = load double, double* %111
%113 = load double*, double** %4
%114 = getelementptr inbounds double, double* %113, i64 2
%115 = load double, double* %114
%116 = fsub double %112, %115
%117 = load double, double* %10
%118 = fmul double %116, %117
%119 = fdiv double %118, 2.000000e+00
%120 = load double*, double** %4
%121 = getelementptr inbounds double, double* %120, i64 5
%122 = load double, double* %121
%123 = load double, double* %9
%124 = call double @llvm.fmuladd.f64(double %122, double %123, double %119)
%125 = load double*, double** %5
%126 = getelementptr inbounds double, double* %125, i64 5
store double %124, double* %126
ret void
}

LLVM IR (-O2):
@M_PI = global double 0.000000e+00
define void @rotate_cmt(double* nocapture %0, double* nocapture writeonly %1, double %2) {
%4 = load double, double* @M_PI
%5 = fmul double %4, %2
%6 = fdiv double %5, 1.800000e+02
%7 = fptosi double %6 to i32
%8 = tail call double @cos(i32 %7)
%9 = load double, double* @M_PI
%10 = fmul double %9, %2
%11 = fdiv double %10, 1.800000e+02
%12 = fptosi double %11 to i32
%13 = tail call double @sin(i32 %12)
%14 = fmul double %2, 2.000000e+00
%15 = load double, double* @M_PI
%16 = fmul double %14, %15
%17 = fdiv double %16, 1.800000e+02
%18 = fptosi double %17 to i32
%19 = tail call double @cos(i32 %18)
%20 = load double, double* @M_PI
%21 = fmul double %14, %20
%22 = fdiv double %21, 1.800000e+02
%23 = fptosi double %22 to i32
%24 = tail call double @sin(i32 %23)
%25 = load double, double* %0
store double %25, double* %1
%26 = getelementptr inbounds double, double* %0, i64 1
%27 = load double, double* %26
%28 = fmul double %8, %27
%29 = getelementptr inbounds double, double* %0, i64 2
%30 = load double, double* %29
%31 = fmul double %13, %30
%32 = fmul double %13, %31
%33 = tail call double @llvm.fmuladd.f64(double %28, double %8, double %32)
%34 = getelementptr inbounds double, double* %0, i64 5
%35 = load double, double* %34
%36 = fneg double %35
%37 = tail call double @llvm.fmuladd.f64(double %36, double %24, double %33)
%38 = getelementptr inbounds double, double* %1, i64 1
store double %37, double* %38
%39 = load double, double* %29
%40 = fmul double %8, %39
%41 = load double, double* %26
%42 = fmul double %13, %41
%43 = fmul double %13, %42
%44 = tail call double @llvm.fmuladd.f64(double %40, double %8, double %43)
%45 = load double, double* %34
%46 = tail call double @llvm.fmuladd.f64(double %45, double %24, double %44)
%47 = getelementptr inbounds double, double* %1, i64 2
store double %46, double* %47
%48 = getelementptr inbounds double, double* %0, i64 3
%49 = load double, double* %48
%50 = getelementptr inbounds double, double* %0, i64 4
%51 = load double, double* %50
%52 = fneg double %51
%53 = fmul double %13, %52
%54 = tail call double @llvm.fmuladd.f64(double %49, double %8, double %53)
%55 = getelementptr inbounds double, double* %1, i64 3
store double %54, double* %55
%56 = load double, double* %48
%57 = load double, double* %50
%58 = fmul double %8, %57
%59 = tail call double @llvm.fmuladd.f64(double %56, double %13, double %58)
%60 = getelementptr inbounds double, double* %1, i64 4
store double %59, double* %60
%61 = load double, double* %26
%62 = load double, double* %29
%63 = fsub double %61, %62
%64 = fmul double %24, %63
%65 = fmul double %64, 5.000000e-01
%66 = load double, double* %34
%67 = tail call double @llvm.fmuladd.f64(double %66, double %19, double %65)
%68 = getelementptr inbounds double, double* %1, i64 5
store double %67, double* %68
ret void
}