#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_backward(double tri[3], double rotx, double roty,
                           double rotz) {
  double sna, csa;
  double newtri[3];
  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];
  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((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);
  tri[0] = newtri[0];
  tri[1] = newtri[1];
  tri[2] = newtri[2];
}


x86 assembly (clang, -O0):
<rotate_point_backward>:
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  -0x20(%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  -0x20(%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  -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  -0x18(%rbp),%xmm0
movsd  0xdf7(%rip),%xmm1
divsd  %xmm1,%xmm0
mov    0x2dd4(%rip),%rax
mulsd  (%rax),%xmm0
call   1030 <sin@plt>
movsd  %xmm0,-0x28(%rbp)
movsd  -0x18(%rbp),%xmm0
movsd  0xdd1(%rip),%xmm1
divsd  %xmm1,%xmm0
mov    0x2dae(%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  -0x10(%rbp),%xmm0
movsd  0xd3d(%rip),%xmm1
divsd  %xmm1,%xmm0
mov    0x2d1a(%rip),%rax
mulsd  (%rax),%xmm0
call   1030 <sin@plt>
movsd  %xmm0,-0x28(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  0xd17(%rip),%xmm1
divsd  %xmm1,%xmm0
mov    0x2cf4(%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  -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_backward>:
push   %r14
push   %rbx
sub    $0x98,%rsp
movsd  %xmm1,0x10(%rsp)
movsd  %xmm0,0x8(%rsp)
mov    %rdi,%rbx
divsd  0xebf(%rip),%xmm2
movsd  %xmm2,0x20(%rsp)
mov    0x2e9a(%rip),%r14
movsd  (%r14),%xmm0
mulsd  %xmm2,%xmm0
call   1030 <sin@plt>
movapd %xmm0,0x30(%rsp)
movsd  0x20(%rsp),%xmm0
mulsd  (%r14),%xmm0
call   1040 <cos@plt>
movapd %xmm0,0x80(%rsp)
movsd  (%rbx),%xmm1
movapd %xmm1,0x70(%rsp)
movsd  0x8(%rbx),%xmm2
movapd %xmm2,0x20(%rsp)
movapd 0x30(%rsp),%xmm3
mulsd  %xmm2,%xmm3
mulsd  %xmm0,%xmm1
subsd  %xmm3,%xmm1
movapd %xmm1,0x60(%rsp)
movsd  0x10(%rbx),%xmm0
movaps %xmm0,0x50(%rsp)
movsd  0x10(%rsp),%xmm1
divsd  0xe40(%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 0x70(%rsp),%xmm3
movapd 0x50(%rsp),%xmm1
unpcklpd %xmm1,%xmm3
movapd 0x40(%rsp),%xmm5
mulsd  %xmm5,%xmm1
movapd %xmm1,%xmm4
movapd 0x60(%rsp),%xmm2
movapd %xmm2,%xmm1
mulsd  %xmm0,%xmm1
addsd  %xmm4,%xmm1
movsd  %xmm1,(%rbx)
xorpd  0xdea(%rip),%xmm2
movapd %xmm2,%xmm4
movapd 0x80(%rsp),%xmm2
unpcklpd %xmm5,%xmm2
movapd 0x20(%rsp),%xmm1
unpcklpd %xmm4,%xmm1
mulpd  %xmm2,%xmm1
movapd %xmm1,%xmm2
movapd 0x30(%rsp),%xmm1
unpcklpd %xmm0,%xmm1
mulpd  %xmm3,%xmm1
addpd  %xmm2,%xmm1
movupd %xmm1,0x8(%rbx)
movsd  0x8(%rsp),%xmm1
divsd  0xd92(%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  0x8(%rbx),%xmm1
movsd  0x10(%rbx),%xmm2
movapd 0xd66(%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,0x8(%rbx)
add    $0x98,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@M_PI = global double 0.000000e+00
define void @rotate_point_backward(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* %8
%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* %8
%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 = load double, double* %10
%26 = load double*, double** %5
%27 = getelementptr inbounds double, double* %26, i64 1
%28 = load double, double* %27
%29 = load double, double* %9
%30 = fmul double %28, %29
%31 = fneg double %30
%32 = call double @llvm.fmuladd.f64(double %24, double %25, double %31)
%33 = getelementptr inbounds [3 x double], [3 x double]* %11, i64 0, i64 0
store double %32, double* %33
%34 = load double*, double** %5
%35 = getelementptr inbounds double, double* %34, i64 0
%36 = load double, double* %35
%37 = load double, double* %9
%38 = load double*, double** %5
%39 = getelementptr inbounds double, double* %38, i64 1
%40 = load double, double* %39
%41 = load double, double* %10
%42 = fmul double %40, %41
%43 = call double @llvm.fmuladd.f64(double %36, double %37, double %42)
%44 = getelementptr inbounds [3 x double], [3 x double]* %11, i64 0, i64 1
store double %43, double* %44
%45 = load double*, double** %5
%46 = getelementptr inbounds double, double* %45, i64 2
%47 = load double, 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* %6
%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* %6
%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 = getelementptr inbounds [3 x double], [3 x double]* %11, i64 0, i64 0
store double %96, double* %97
%98 = load double*, double** %5
%99 = getelementptr inbounds double, double* %98, i64 1
%100 = load double, double* %99
%101 = load double, double* %10
%102 = load double*, double** %5
%103 = getelementptr inbounds double, double* %102, i64 2
%104 = load double, double* %103
%105 = load double, double* %9
%106 = fmul double %104, %105
%107 = fneg double %106
%108 = call double @llvm.fmuladd.f64(double %100, double %101, double %107)
%109 = getelementptr inbounds [3 x double], [3 x double]* %11, i64 0, i64 1
store double %108, double* %109
%110 = load double*, double** %5
%111 = getelementptr inbounds double, double* %110, i64 1
%112 = load double, double* %111
%113 = load double, double* %9
%114 = load double*, double** %5
%115 = getelementptr inbounds double, double* %114, i64 2
%116 = load double, double* %115
%117 = load double, double* %10
%118 = fmul double %116, %117
%119 = call double @llvm.fmuladd.f64(double %112, double %113, 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_backward(double* nocapture %0, double %1, double %2, double %3) {
%5 = fdiv double %3, 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 = load double, double* %0
%13 = getelementptr inbounds double, double* %0, i64 1
%14 = load double, double* %13
%15 = fneg double %14
%16 = fmul double %8, %15
%17 = tail call double @llvm.fmuladd.f64(double %12, double %11, double %16)
%18 = getelementptr inbounds double, double* %0, i64 2
%19 = load double, double* %18
%20 = fdiv double %2, 1.800000e+02
%21 = load double, double* @M_PI
%22 = fmul double %20, %21
%23 = tail call double @sin(double %22)
%24 = load double, double* @M_PI
%25 = fmul double %20, %24
%26 = tail call double @cos(double %25)
%27 = fmul double %19, %23
%28 = tail call double @llvm.fmuladd.f64(double %17, double %26, double %27)
store double %28, double* %0
%29 = fneg double %17
%30 = insertelement <2 x double> poison, double %11, i64 0
%31 = insertelement <2 x double> %30, double %23, i64 1
%32 = insertelement <2 x double> poison, double %14, i64 0
%33 = insertelement <2 x double> %32, double %29, i64 1
%34 = fmul <2 x double> %31, %33
%35 = insertelement <2 x double> poison, double %12, i64 0
%36 = insertelement <2 x double> %35, double %19, i64 1
%37 = insertelement <2 x double> poison, double %8, i64 0
%38 = insertelement <2 x double> %37, double %26, i64 1
%39 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %36, <2 x double> %38, <2 x double> %34)
%40 = bitcast double* %13 to <2 x double>*
store <2 x double> %39, <2 x double>* %40
%41 = fdiv double %1, 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* %13
%49 = load double, double* %18
%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* %13 to <2 x double>*
store <2 x double> %60, <2 x double>* %61
ret void
}