#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_2_ortho_traces(double *T, double *P, float baz, int npts, double *N,
                           double *E) {
  double co, si;
  int j;
  co = cos(M_PI * (double)baz / 180.);
  si = sin(M_PI * (double)baz / 180.);
  for (j = 0; j < npts; j++) {
    N[j] = -co * T[j] - si * P[j];
    E[j] = -si * T[j] + co * P[j];
  }
}


x86 assembly (clang, -O0):
<rotate_2_ortho_traces>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movss  %xmm0,-0x14(%rbp)
mov    %edx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    0x2ea1(%rip),%rax
movsd  (%rax),%xmm0
movss  -0x14(%rbp),%xmm1
cvtss2sd %xmm1,%xmm1
mulsd  %xmm1,%xmm0
movsd  0xea0(%rip),%xmm1
divsd  %xmm1,%xmm0
call   1040 <cos@plt>
movsd  %xmm0,-0x30(%rbp)
mov    0x2e73(%rip),%rax
movsd  (%rax),%xmm0
movss  -0x14(%rbp),%xmm1
cvtss2sd %xmm1,%xmm1
mulsd  %xmm1,%xmm0
movsd  0xe72(%rip),%xmm1
divsd  %xmm1,%xmm0
call   1030 <sin@plt>
movsd  %xmm0,-0x38(%rbp)
movl   $0x0,-0x3c(%rbp)
mov    -0x3c(%rbp),%eax
cmp    -0x18(%rbp),%eax
jge    1274 <rotate_2_ortho_traces+0x154>
movsd  -0x30(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mov    -0x8(%rbp),%rax
movslq -0x3c(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm2
movsd  -0x38(%rbp),%xmm1
mov    -0x10(%rbp),%rax
movslq -0x3c(%rbp),%rcx
mulsd  (%rax,%rcx,8),%xmm1
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
mov    -0x20(%rbp),%rax
movslq -0x3c(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
movsd  -0x38(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mov    -0x8(%rbp),%rax
movslq -0x3c(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm2
movsd  -0x30(%rbp),%xmm1
mov    -0x10(%rbp),%rax
movslq -0x3c(%rbp),%rcx
mulsd  (%rax,%rcx,8),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
mov    -0x28(%rbp),%rax
movslq -0x3c(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x3c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x3c(%rbp)
jmp    11a3 <rotate_2_ortho_traces+0x83>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rotate_2_ortho_traces>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x28,%rsp
mov    %r8,%r14
mov    %rcx,%r15
mov    %edx,%ebp
mov    %rsi,%r12
mov    %rdi,%rbx
mov    0x2ea5(%rip),%r13
cvtss2sd %xmm0,%xmm1
movsd  %xmm1,0x8(%rsp)
movsd  0x0(%r13),%xmm0
mulsd  %xmm1,%xmm0
divsd  0xea1(%rip),%xmm0
call   1040 <cos@plt>
movapd %xmm0,0x10(%rsp)
movsd  0x8(%rsp),%xmm0
mulsd  0x0(%r13),%xmm0
divsd  0xe82(%rip),%xmm0
call   1030 <sin@plt>
movapd 0x10(%rsp),%xmm7
test   %ebp,%ebp
jle    11f3 <rotate_2_ortho_traces+0xd3>
movapd 0xe7b(%rip),%xmm2
movapd %xmm7,%xmm1
xorpd  %xmm2,%xmm1
xorpd  %xmm2,%xmm0
mov    %ebp,%eax
cmp    $0x1,%ebp
jne    1202 <rotate_2_ortho_traces+0xe2>
xor    %ecx,%ecx
nopw   0x0(%rax,%rax,1)
movsd  (%r12,%rcx,8),%xmm2
mulsd  %xmm0,%xmm2
movsd  (%rbx,%rcx,8),%xmm3
mulsd  %xmm1,%xmm3
addsd  %xmm2,%xmm3
movsd  %xmm3,(%r15,%rcx,8)
movsd  (%r12,%rcx,8),%xmm2
mulsd  %xmm7,%xmm2
movsd  (%rbx,%rcx,8),%xmm3
mulsd  %xmm0,%xmm3
addsd  %xmm2,%xmm3
movsd  %xmm3,(%r14,%rcx,8)
add    $0x1,%rcx
cmp    %rcx,%rax
jne    11b0 <rotate_2_ortho_traces+0x90>
add    $0x28,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
lea    (%r14,%rax,8),%rcx
cmp    %r15,%rcx
seta   0x8(%rsp)
lea    (%r15,%rax,8),%rdi
cmp    %r14,%rdi
seta   %bpl
lea    (%rbx,%rax,8),%rsi
cmp    %r15,%rsi
seta   %r13b
cmp    %rbx,%rdi
seta   %r9b
lea    (%r12,%rax,8),%rdx
cmp    %r15,%rdx
seta   %r11b
cmp    %r12,%rdi
seta   %r10b
cmp    %r14,%rsi
seta   %dil
cmp    %rbx,%rcx
seta   %sil
cmp    %r14,%rdx
seta   %r8b
cmp    %r12,%rcx
seta   %dl
xor    %ecx,%ecx
test   %bpl,0x8(%rsp)
jne    11b0 <rotate_2_ortho_traces+0x90>
and    %r9b,%r13b
jne    11b0 <rotate_2_ortho_traces+0x90>
and    %r10b,%r11b
jne    11b0 <rotate_2_ortho_traces+0x90>
and    %sil,%dil
jne    11b0 <rotate_2_ortho_traces+0x90>
and    %dl,%r8b
jne    11b0 <rotate_2_ortho_traces+0x90>
mov    %eax,%ecx
and    $0xfffffffe,%ecx
movapd %xmm0,%xmm2
unpcklpd %xmm0,%xmm2
movapd %xmm1,%xmm4
unpcklpd %xmm1,%xmm4
movapd %xmm7,%xmm3
unpcklpd %xmm7,%xmm3
lea    -0x2(%rcx),%rdx
mov    %rdx,%rsi
shr    %rsi
add    $0x1,%rsi
test   %rdx,%rdx
je     13a6 <rotate_2_ortho_traces+0x286>
mov    %rsi,%rdi
and    $0xfffffffffffffffe,%rdi
xor    %edx,%edx
cs nopw 0x0(%rax,%rax,1)
movupd (%rbx,%rdx,8),%xmm5
movupd (%r12,%rdx,8),%xmm6
mulpd  %xmm2,%xmm6
mulpd  %xmm4,%xmm5
addpd  %xmm6,%xmm5
movupd %xmm5,(%r15,%rdx,8)
movupd (%rbx,%rdx,8),%xmm5
movupd (%r12,%rdx,8),%xmm6
mulpd  %xmm3,%xmm6
mulpd  %xmm2,%xmm5
addpd  %xmm6,%xmm5
movupd %xmm5,(%r14,%rdx,8)
movupd 0x10(%rbx,%rdx,8),%xmm5
movupd 0x10(%r12,%rdx,8),%xmm6
mulpd  %xmm2,%xmm6
mulpd  %xmm4,%xmm5
addpd  %xmm6,%xmm5
movupd %xmm5,0x10(%r15,%rdx,8)
movupd 0x10(%rbx,%rdx,8),%xmm5
movupd 0x10(%r12,%rdx,8),%xmm6
mulpd  %xmm3,%xmm6
mulpd  %xmm2,%xmm5
addpd  %xmm6,%xmm5
movupd %xmm5,0x10(%r14,%rdx,8)
add    $0x4,%rdx
add    $0xfffffffffffffffe,%rdi
jne    12d0 <rotate_2_ortho_traces+0x1b0>
test   $0x1,%sil
je     1398 <rotate_2_ortho_traces+0x278>
movupd (%rbx,%rdx,8),%xmm5
movupd (%r12,%rdx,8),%xmm6
mulpd  %xmm2,%xmm6
mulpd  %xmm5,%xmm4
addpd  %xmm6,%xmm4
movupd %xmm4,(%r15,%rdx,8)
movupd (%rbx,%rdx,8),%xmm4
movupd (%r12,%rdx,8),%xmm5
mulpd  %xmm5,%xmm3
mulpd  %xmm2,%xmm4
addpd  %xmm3,%xmm4
movupd %xmm4,(%r14,%rdx,8)
cmp    %rax,%rcx
jne    11b0 <rotate_2_ortho_traces+0x90>
jmp    11f3 <rotate_2_ortho_traces+0xd3>
xor    %edx,%edx
test   $0x1,%sil
jne    135e <rotate_2_ortho_traces+0x23e>
jmp    1398 <rotate_2_ortho_traces+0x278>

LLVM IR (-O0):
@M_PI = global double 0.000000e+00
define void @rotate_2_ortho_traces(double* %0, double* %1, float %2, i32 %3, double* %4, double* %5) {
%7 = alloca double*
%8 = alloca double*
%9 = alloca float
%10 = alloca i32
%11 = alloca double*
%12 = alloca double*
%13 = alloca double
%14 = alloca double
%15 = alloca i32
store double* %0, double** %7
store double* %1, double** %8
store float %2, float* %9
store i32 %3, i32* %10
store double* %4, double** %11
store double* %5, double** %12
%16 = load double, double* @M_PI
%17 = load float, float* %9
%18 = fpext float %17 to double
%19 = fmul double %16, %18
%20 = fdiv double %19, 1.800000e+02
%21 = call double @cos(double %20)
store double %21, double* %13
%22 = load double, double* @M_PI
%23 = load float, float* %9
%24 = fpext float %23 to double
%25 = fmul double %22, %24
%26 = fdiv double %25, 1.800000e+02
%27 = call double @sin(double %26)
store double %27, double* %14
store i32 0, i32* %15
br label %28
28: ; preds = %72, %6
%29 = load i32, i32* %15
%30 = load i32, i32* %10
%31 = icmp slt i32 %29, %30
br i1 %31, label %32, label %75
32: ; preds = %28
%33 = load double, double* %13
%34 = fneg double %33
%35 = load double*, double** %7
%36 = load i32, i32* %15
%37 = sext i32 %36 to i64
%38 = getelementptr inbounds double, double* %35, i64 %37
%39 = load double, double* %38
%40 = load double, double* %14
%41 = load double*, double** %8
%42 = load i32, i32* %15
%43 = sext i32 %42 to i64
%44 = getelementptr inbounds double, double* %41, i64 %43
%45 = load double, double* %44
%46 = fmul double %40, %45
%47 = fneg double %46
%48 = call double @llvm.fmuladd.f64(double %34, double %39, double %47)
%49 = load double*, double** %11
%50 = load i32, i32* %15
%51 = sext i32 %50 to i64
%52 = getelementptr inbounds double, double* %49, i64 %51
store double %48, double* %52
%53 = load double, double* %14
%54 = fneg double %53
%55 = load double*, double** %7
%56 = load i32, i32* %15
%57 = sext i32 %56 to i64
%58 = getelementptr inbounds double, double* %55, i64 %57
%59 = load double, double* %58
%60 = load double, double* %13
%61 = load double*, double** %8
%62 = load i32, i32* %15
%63 = sext i32 %62 to i64
%64 = getelementptr inbounds double, double* %61, i64 %63
%65 = load double, double* %64
%66 = fmul double %60, %65
%67 = call double @llvm.fmuladd.f64(double %54, double %59, double %66)
%68 = load double*, double** %12
%69 = load i32, i32* %15
%70 = sext i32 %69 to i64
%71 = getelementptr inbounds double, double* %68, i64 %70
store double %67, double* %71
br label %72
72: ; preds = %32
%73 = load i32, i32* %15
%74 = add nsw i32 %73, 1
store i32 %74, i32* %15
br label %28
75: ; preds = %28
ret void
}

LLVM IR (-O2):
@M_PI = global double 0.000000e+00
define void @rotate_2_ortho_traces(double* nocapture %0, double* nocapture %1, float %2, i32 %3, double* nocapture writeonly %4, double* nocapture writeonly %5) {
%7 = load double, double* @M_PI
%8 = fpext float %2 to double
%9 = fmul double %7, %8
%10 = fdiv double %9, 1.800000e+02
%11 = tail call double @cos(double %10)
%12 = load double, double* @M_PI
%13 = fmul double %12, %8
%14 = fdiv double %13, 1.800000e+02
%15 = tail call double @sin(double %14)
%16 = icmp sgt i32 %3, 0
br i1 %16, label %17, label %146
17: ; preds = %6
%18 = fneg double %11
%19 = fneg double %15
%20 = zext i32 %3 to i64
%21 = icmp eq i32 %3, 1
br i1 %21, label %128, label %22
22: ; preds = %17
%23 = getelementptr double, double* %4, i64 %20
%24 = getelementptr double, double* %5, i64 %20
%25 = getelementptr double, double* %0, i64 %20
%26 = getelementptr double, double* %1, i64 %20
%27 = icmp ugt double* %24, %4
%28 = icmp ugt double* %23, %5
%29 = and i1 %27, %28
%30 = icmp ugt double* %25, %4
%31 = icmp ugt double* %23, %0
%32 = and i1 %30, %31
%33 = or i1 %29, %32
%34 = icmp ugt double* %26, %4
%35 = icmp ugt double* %23, %1
%36 = and i1 %34, %35
%37 = or i1 %33, %36
%38 = icmp ugt double* %25, %5
%39 = icmp ugt double* %24, %0
%40 = and i1 %38, %39
%41 = or i1 %37, %40
%42 = icmp ugt double* %26, %5
%43 = icmp ugt double* %24, %1
%44 = and i1 %42, %43
%45 = or i1 %41, %44
br i1 %45, label %128, label %46
46: ; preds = %22
%47 = and i64 %20, 4294967294
%48 = insertelement <2 x double> poison, double %19, i64 0
%49 = shufflevector <2 x double> %48, <2 x double> poison, <2 x i32> zeroinitializer
%50 = insertelement <2 x double> poison, double %18, i64 0
%51 = shufflevector <2 x double> %50, <2 x double> poison, <2 x i32> zeroinitializer
%52 = insertelement <2 x double> poison, double %11, i64 0
%53 = shufflevector <2 x double> %52, <2 x double> poison, <2 x i32> zeroinitializer
%54 = add nsw i64 %47, -2
%55 = lshr exact i64 %54, 1
%56 = add nuw i64 %55, 1
%57 = and i64 %56, 1
%58 = icmp eq i64 %54, 0
br i1 %58, label %104, label %59
59: ; preds = %46
%60 = and i64 %56, -2
br label %61
61: ; preds = %61, %59
%62 = phi i64 [ 0, %59 ], [ %101, %61 ]
%63 = phi i64 [ 0, %59 ], [ %102, %61 ]
%64 = getelementptr inbounds double, double* %0, i64 %62
%65 = bitcast double* %64 to <2 x double>*
%66 = load <2 x double>, <2 x double>* %65
%67 = getelementptr inbounds double, double* %1, i64 %62
%68 = bitcast double* %67 to <2 x double>*
%69 = load <2 x double>, <2 x double>* %68
%70 = fmul <2 x double> %69, %49
%71 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %51, <2 x double> %66, <2 x double> %70)
%72 = getelementptr inbounds double, double* %4, i64 %62
%73 = bitcast double* %72 to <2 x double>*
store <2 x double> %71, <2 x double>* %73
%74 = bitcast double* %64 to <2 x double>*
%75 = load <2 x double>, <2 x double>* %74
%76 = bitcast double* %67 to <2 x double>*
%77 = load <2 x double>, <2 x double>* %76
%78 = fmul <2 x double> %53, %77
%79 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %49, <2 x double> %75, <2 x double> %78)
%80 = getelementptr inbounds double, double* %5, i64 %62
%81 = bitcast double* %80 to <2 x double>*
store <2 x double> %79, <2 x double>* %81
%82 = or i64 %62, 2
%83 = getelementptr inbounds double, double* %0, i64 %82
%84 = bitcast double* %83 to <2 x double>*
%85 = load <2 x double>, <2 x double>* %84
%86 = getelementptr inbounds double, double* %1, i64 %82
%87 = bitcast double* %86 to <2 x double>*
%88 = load <2 x double>, <2 x double>* %87
%89 = fmul <2 x double> %88, %49
%90 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %51, <2 x double> %85, <2 x double> %89)
%91 = getelementptr inbounds double, double* %4, i64 %82
%92 = bitcast double* %91 to <2 x double>*
store <2 x double> %90, <2 x double>* %92
%93 = bitcast double* %83 to <2 x double>*
%94 = load <2 x double>, <2 x double>* %93
%95 = bitcast double* %86 to <2 x double>*
%96 = load <2 x double>, <2 x double>* %95
%97 = fmul <2 x double> %53, %96
%98 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %49, <2 x double> %94, <2 x double> %97)
%99 = getelementptr inbounds double, double* %5, i64 %82
%100 = bitcast double* %99 to <2 x double>*
store <2 x double> %98, <2 x double>* %100
%101 = add nuw i64 %62, 4
%102 = add nuw i64 %63, 2
%103 = icmp eq i64 %102, %60
br i1 %103, label %104, label %61
104: ; preds = %61, %46
%105 = phi i64 [ 0, %46 ], [ %101, %61 ]
%106 = icmp eq i64 %57, 0
br i1 %106, label %126, label %107
107: ; preds = %104
%108 = getelementptr inbounds double, double* %0, i64 %105
%109 = bitcast double* %108 to <2 x double>*
%110 = load <2 x double>, <2 x double>* %109
%111 = getelementptr inbounds double, double* %1, i64 %105
%112 = bitcast double* %111 to <2 x double>*
%113 = load <2 x double>, <2 x double>* %112
%114 = fmul <2 x double> %113, %49
%115 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %51, <2 x double> %110, <2 x double> %114)
%116 = getelementptr inbounds double, double* %4, i64 %105
%117 = bitcast double* %116 to <2 x double>*
store <2 x double> %115, <2 x double>* %117
%118 = bitcast double* %108 to <2 x double>*
%119 = load <2 x double>, <2 x double>* %118
%120 = bitcast double* %111 to <2 x double>*
%121 = load <2 x double>, <2 x double>* %120
%122 = fmul <2 x double> %53, %121
%123 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %49, <2 x double> %119, <2 x double> %122)
%124 = getelementptr inbounds double, double* %5, i64 %105
%125 = bitcast double* %124 to <2 x double>*
store <2 x double> %123, <2 x double>* %125
br label %126
126: ; preds = %104, %107
%127 = icmp eq i64 %47, %20
br i1 %127, label %146, label %128
128: ; preds = %22, %17, %126
%129 = phi i64 [ 0, %22 ], [ 0, %17 ], [ %47, %126 ]
br label %130
130: ; preds = %128, %130
%131 = phi i64 [ %144, %130 ], [ %129, %128 ]
%132 = getelementptr inbounds double, double* %0, i64 %131
%133 = load double, double* %132
%134 = getelementptr inbounds double, double* %1, i64 %131
%135 = load double, double* %134
%136 = fmul double %135, %19
%137 = tail call double @llvm.fmuladd.f64(double %18, double %133, double %136)
%138 = getelementptr inbounds double, double* %4, i64 %131
store double %137, double* %138
%139 = load double, double* %132
%140 = load double, double* %134
%141 = fmul double %11, %140
%142 = tail call double @llvm.fmuladd.f64(double %19, double %139, double %141)
%143 = getelementptr inbounds double, double* %5, i64 %131
store double %142, double* %143
%144 = add nuw nsw i64 %131, 1
%145 = icmp eq i64 %144, %20
br i1 %145, label %146, label %130
146: ; preds = %130, %126, %6
ret void
}