#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(double);
double sin(double);
void rotate_point_forward(double tri[3], double rotx, double roty,
                          double rotz) {
  double sna, csa;
  double newtri[3];
  sna = sin((rotx) / 180 * M_PI);
  csa = cos((rotx) / 180 * M_PI);
  newtri[0] = tri[0];
  newtri[1] = (tri[1] * csa) - (tri[2] * sna);
  newtri[2] = (tri[1] * sna) + (tri[2] * csa);
  sna = sin((roty) / 180 * M_PI);
  csa = cos((roty) / 180 * M_PI);
  tri[0] = (newtri[0] * csa) + (newtri[2] * sna);
  tri[1] = newtri[1];
  tri[2] = (newtri[2] * csa) - (newtri[0] * sna);
  sna = sin((rotz) / 180 * M_PI);
  csa = cos((rotz) / 180 * M_PI);
  newtri[0] = (tri[0] * csa) - (tri[1] * sna);
  newtri[1] = (tri[0] * sna) + (tri[1] * csa);
  newtri[2] = tri[2];
  tri[0] = newtri[0];
  tri[1] = newtri[1];
  tri[2] = newtri[2];
}


x86 assembly (clang, -O0):
<rotate_point_forward>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
mov    %rdi,-0x8(%rbp)
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x18(%rbp)
movsd  %xmm2,-0x20(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  0xeb8(%rip),%xmm1
divsd  %xmm1,%xmm0
mov    0x2e95(%rip),%rax
mulsd  (%rax),%xmm0
call   1030 <sin@plt>
movsd  %xmm0,-0x28(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  0xe92(%rip),%xmm1
divsd  %xmm1,%xmm0
mov    0x2e6f(%rip),%rax
mulsd  (%rax),%xmm0
call   1040 <cos@plt>
movsd  %xmm0,-0x30(%rbp)
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm0
movsd  %xmm0,-0x50(%rbp)
mov    -0x8(%rbp),%rax
movsd  0x8(%rax),%xmm0
movsd  -0x30(%rbp),%xmm2
mov    -0x8(%rbp),%rax
movsd  0x10(%rax),%xmm1
mulsd  -0x28(%rbp),%xmm1
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x48(%rbp)
mov    -0x8(%rbp),%rax
movsd  0x8(%rax),%xmm0
movsd  -0x28(%rbp),%xmm2
mov    -0x8(%rbp),%rax
movsd  0x10(%rax),%xmm1
mulsd  -0x30(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x40(%rbp)
movsd  -0x18(%rbp),%xmm0
movsd  0xdf6(%rip),%xmm1
divsd  %xmm1,%xmm0
mov    0x2dd3(%rip),%rax
mulsd  (%rax),%xmm0
call   1030 <sin@plt>
movsd  %xmm0,-0x28(%rbp)
movsd  -0x18(%rbp),%xmm0
movsd  0xdd0(%rip),%xmm1
divsd  %xmm1,%xmm0
mov    0x2dad(%rip),%rax
mulsd  (%rax),%xmm0
call   1040 <cos@plt>
movsd  %xmm0,-0x30(%rbp)
movsd  -0x50(%rbp),%xmm0
movsd  -0x30(%rbp),%xmm2
movsd  -0x40(%rbp),%xmm1
mulsd  -0x28(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
mov    -0x8(%rbp),%rax
movsd  %xmm0,(%rax)
movsd  -0x48(%rbp),%xmm0
mov    -0x8(%rbp),%rax
movsd  %xmm0,0x8(%rax)
movsd  -0x40(%rbp),%xmm0
movsd  -0x30(%rbp),%xmm2
movsd  -0x50(%rbp),%xmm1
mulsd  -0x28(%rbp),%xmm1
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
mov    -0x8(%rbp),%rax
movsd  %xmm0,0x10(%rax)
movsd  -0x20(%rbp),%xmm0
movsd  0xd3c(%rip),%xmm1
divsd  %xmm1,%xmm0
mov    0x2d19(%rip),%rax
mulsd  (%rax),%xmm0
call   1030 <sin@plt>
movsd  %xmm0,-0x28(%rbp)
movsd  -0x20(%rbp),%xmm0
movsd  0xd16(%rip),%xmm1
divsd  %xmm1,%xmm0
mov    0x2cf3(%rip),%rax
mulsd  (%rax),%xmm0
call   1040 <cos@plt>
movsd  %xmm0,-0x30(%rbp)
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm0
movsd  -0x30(%rbp),%xmm2
mov    -0x8(%rbp),%rax
movsd  0x8(%rax),%xmm1
mulsd  -0x28(%rbp),%xmm1
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x50(%rbp)
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm0
movsd  -0x28(%rbp),%xmm2
mov    -0x8(%rbp),%rax
movsd  0x8(%rax),%xmm1
mulsd  -0x30(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x48(%rbp)
mov    -0x8(%rbp),%rax
movsd  0x10(%rax),%xmm0
movsd  %xmm0,-0x40(%rbp)
movsd  -0x50(%rbp),%xmm0
mov    -0x8(%rbp),%rax
movsd  %xmm0,(%rax)
movsd  -0x48(%rbp),%xmm0
mov    -0x8(%rbp),%rax
movsd  %xmm0,0x8(%rax)
movsd  -0x40(%rbp),%xmm0
mov    -0x8(%rbp),%rax
movsd  %xmm0,0x10(%rax)
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rotate_point_forward>:
push   %r14
push   %rbx
sub    $0x88,%rsp
movsd  %xmm2,0x8(%rsp)
movsd  %xmm1,0x10(%rsp)
movapd %xmm0,%xmm1
mov    %rdi,%rbx
divsd  0xebb(%rip),%xmm1
movsd  %xmm1,0x20(%rsp)
mov    0x2e96(%rip),%r14
movsd  (%r14),%xmm0
mulsd  %xmm1,%xmm0
call   1030 <sin@plt>
movapd %xmm0,0x30(%rsp)
movsd  0x20(%rsp),%xmm0
mulsd  (%r14),%xmm0
call   1040 <cos@plt>
movapd %xmm0,0x20(%rsp)
movupd (%rbx),%xmm1
movapd %xmm1,0x70(%rsp)
movsd  0x10(%rbx),%xmm2
movapd %xmm0,%xmm3
mulsd  %xmm2,%xmm3
xorpd  0xe75(%rip),%xmm2
movapd %xmm2,0x60(%rsp)
movapd %xmm1,%xmm0
unpckhpd %xmm1,%xmm0
mulsd  0x30(%rsp),%xmm0
addsd  %xmm3,%xmm0
movapd %xmm0,0x50(%rsp)
movsd  0x10(%rsp),%xmm1
divsd  0xe39(%rip),%xmm1
movsd  %xmm1,0x10(%rsp)
movsd  (%r14),%xmm0
mulsd  %xmm1,%xmm0
call   1030 <sin@plt>
movapd %xmm0,0x40(%rsp)
movsd  0x10(%rsp),%xmm0
mulsd  (%r14),%xmm0
call   1040 <cos@plt>
movapd 0x50(%rsp),%xmm3
movapd %xmm3,%xmm1
unpcklpd 0x30(%rsp),%xmm1
movapd 0x40(%rsp),%xmm4
movapd %xmm4,%xmm2
unpcklpd 0x60(%rsp),%xmm2
mulpd  %xmm1,%xmm2
mulsd  %xmm0,%xmm3
unpcklpd 0x20(%rsp),%xmm0
movapd 0x70(%rsp),%xmm1
mulpd  %xmm1,%xmm0
addpd  %xmm2,%xmm0
movupd %xmm0,(%rbx)
movapd %xmm4,%xmm0
mulsd  %xmm1,%xmm0
subsd  %xmm0,%xmm3
movsd  %xmm3,0x10(%rbx)
movsd  0x8(%rsp),%xmm1
divsd  0xdb0(%rip),%xmm1
movsd  %xmm1,0x8(%rsp)
movsd  (%r14),%xmm0
mulsd  %xmm1,%xmm0
call   1030 <sin@plt>
movapd %xmm0,0x10(%rsp)
movsd  0x8(%rsp),%xmm0
mulsd  (%r14),%xmm0
call   1040 <cos@plt>
movsd  (%rbx),%xmm1
movsd  0x8(%rbx),%xmm2
movapd 0xd85(%rip),%xmm4
xorpd  %xmm2,%xmm4
movapd 0x10(%rsp),%xmm5
movapd %xmm5,%xmm3
unpcklpd %xmm0,%xmm3
unpcklpd %xmm2,%xmm4
mulpd  %xmm3,%xmm4
unpcklpd %xmm1,%xmm1
unpcklpd %xmm5,%xmm0
mulpd  %xmm1,%xmm0
addpd  %xmm4,%xmm0
movupd %xmm0,(%rbx)
add    $0x88,%rsp
pop    %rbx
pop    %r14
ret

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

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