#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 */
int cos(double const);
int sin(double const);
int /*<<< orphan*/ trace(int, char *, double const, double const, ...);
void tide_pole(const double *pos, const double *erpv, double *denu) {
  double xp, yp, cosl, sinl;
  trace(3, "tide_pole: pos=%.3f %.3f\n", pos[0] * (180.0 / 3.1415926535897932),
        pos[1] * (180.0 / 3.1415926535897932));
  xp = erpv[0] / ((3.1415926535897932 / 180.0) / 3600.0);
  yp = erpv[1] / ((3.1415926535897932 / 180.0) / 3600.0);
  cosl = cos(pos[1]);
  sinl = sin(pos[1]);
  denu[0] = 9E-3 * sin(pos[0]) * (xp * sinl + yp * cosl);
  denu[1] = -9E-3 * cos(2.0 * pos[0]) * (xp * cosl - yp * sinl);
  denu[2] = -32E-3 * sin(2.0 * pos[0]) * (xp * cosl - yp * sinl);
  trace(5, "tide_pole : denu=%.3f %.3f %.3f\n", denu[0], denu[1], denu[2]);
}


x86 assembly (clang, -O0):
<tide_pole>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
movsd  0xed8(%rip),%xmm0
mulsd  (%rax),%xmm0
mov    -0x8(%rbp),%rax
movsd  0xec8(%rip),%xmm1
mulsd  0x8(%rax),%xmm1
mov    $0x3,%edi
lea    0xebf(%rip),%rsi
mov    $0x2,%al
call   1050 <trace@plt>
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm0
movsd  0xe98(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x20(%rbp)
mov    -0x10(%rbp),%rax
movsd  0x8(%rax),%xmm0
movsd  0xe7e(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x28(%rbp)
mov    -0x8(%rbp),%rax
movsd  0x8(%rax),%xmm0
call   1040 <cos@plt>
cvtsi2sd %eax,%xmm0
movsd  %xmm0,-0x30(%rbp)
mov    -0x8(%rbp),%rax
movsd  0x8(%rax),%xmm0
call   1030 <sin@plt>
cvtsi2sd %eax,%xmm0
movsd  %xmm0,-0x38(%rbp)
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm0
call   1030 <sin@plt>
cvtsi2sd %eax,%xmm1
movsd  0xe26(%rip),%xmm0
mulsd  %xmm1,%xmm0
movsd  -0x20(%rbp),%xmm1
movsd  -0x38(%rbp),%xmm3
movsd  -0x28(%rbp),%xmm2
mulsd  -0x30(%rbp),%xmm2
mulsd  %xmm3,%xmm1
addsd  %xmm2,%xmm1
mulsd  %xmm1,%xmm0
mov    -0x18(%rbp),%rax
movsd  %xmm0,(%rax)
mov    -0x8(%rbp),%rax
movsd  0xdde(%rip),%xmm0
mulsd  (%rax),%xmm0
call   1040 <cos@plt>
cvtsi2sd %eax,%xmm1
movsd  0xdd1(%rip),%xmm0
mulsd  %xmm1,%xmm0
movsd  -0x20(%rbp),%xmm1
movsd  -0x30(%rbp),%xmm3
movsd  -0x28(%rbp),%xmm2
mulsd  -0x38(%rbp),%xmm2
movq   %xmm2,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm2
mulsd  %xmm3,%xmm1
addsd  %xmm2,%xmm1
mulsd  %xmm1,%xmm0
mov    -0x18(%rbp),%rax
movsd  %xmm0,0x8(%rax)
mov    -0x8(%rbp),%rax
movsd  0xd79(%rip),%xmm0
mulsd  (%rax),%xmm0
call   1030 <sin@plt>
cvtsi2sd %eax,%xmm1
movsd  0xd5c(%rip),%xmm0
mulsd  %xmm1,%xmm0
movsd  -0x20(%rbp),%xmm1
movsd  -0x30(%rbp),%xmm3
movsd  -0x28(%rbp),%xmm2
mulsd  -0x38(%rbp),%xmm2
movq   %xmm2,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm2
mulsd  %xmm3,%xmm1
addsd  %xmm2,%xmm1
mulsd  %xmm1,%xmm0
mov    -0x18(%rbp),%rax
movsd  %xmm0,0x10(%rax)
mov    -0x18(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x18(%rbp),%rax
movsd  0x8(%rax),%xmm1
mov    -0x18(%rbp),%rax
movsd  0x10(%rax),%xmm2
mov    $0x5,%edi
lea    0xd3c(%rip),%rsi
mov    $0x3,%al
call   1050 <trace@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tide_pole>:
push   %r15
push   %r14
push   %rbx
sub    $0x20,%rsp
mov    %rdx,%r14
mov    %rsi,%r15
mov    %rdi,%rbx
movsd  0xeb6(%rip),%xmm1
movsd  (%rdi),%xmm0
mulsd  %xmm1,%xmm0
mulsd  0x8(%rdi),%xmm1
lea    0xeca(%rip),%rsi
mov    $0x3,%edi
mov    $0x2,%al
call   1050 <trace@plt>
movsd  (%r15),%xmm1
movsd  0x8(%r15),%xmm2
movsd  0xe8b(%rip),%xmm0
divsd  %xmm0,%xmm1
movsd  %xmm1,(%rsp)
divsd  %xmm0,%xmm2
movsd  %xmm2,0x18(%rsp)
movsd  0x8(%rbx),%xmm0
call   1040 <cos@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
movsd  %xmm0,0x10(%rsp)
movsd  0x8(%rbx),%xmm0
call   1030 <sin@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
movsd  %xmm0,0x8(%rsp)
movsd  (%rbx),%xmm0
call   1030 <sin@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
mulsd  0xe3a(%rip),%xmm0
movsd  0x18(%rsp),%xmm1
mulsd  0x10(%rsp),%xmm1
movsd  (%rsp),%xmm2
mulsd  0x8(%rsp),%xmm2
addsd  %xmm1,%xmm2
mulsd  %xmm0,%xmm2
movsd  %xmm2,(%r14)
movsd  (%rbx),%xmm0
addsd  %xmm0,%xmm0
call   1040 <cos@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
mulsd  0xe02(%rip),%xmm0
movsd  0x18(%rsp),%xmm2
mulsd  0x8(%rsp),%xmm2
movsd  (%rsp),%xmm1
mulsd  0x10(%rsp),%xmm1
subsd  %xmm2,%xmm1
movsd  %xmm1,(%rsp)
mulsd  %xmm1,%xmm0
movsd  %xmm0,0x8(%r14)
movsd  (%rbx),%xmm0
addsd  %xmm0,%xmm0
call   1030 <sin@plt>
xorps  %xmm2,%xmm2
cvtsi2sd %eax,%xmm2
mulsd  0xdc4(%rip),%xmm2
mulsd  (%rsp),%xmm2
movsd  %xmm2,0x10(%r14)
movsd  (%r14),%xmm0
movsd  0x8(%r14),%xmm1
lea    0xdc9(%rip),%rsi
mov    $0x5,%edi
mov    $0x3,%al
add    $0x20,%rsp
pop    %rbx
pop    %r14
pop    %r15
jmp    1050 <trace@plt>

LLVM IR (-O0):
@.str = [26 x i8] c"tide_pole: pos=%.3f %.3f\0A\00"
@.str.1 = [33 x i8] c"tide_pole : denu=%.3f %.3f %.3f\0A\00"
define void @tide_pole(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** %4
%12 = getelementptr inbounds double, double* %11, i64 0
%13 = load double, double* %12
%14 = fmul double %13, 0x404CA5DC1A63C1F8
%15 = load double*, double** %4
%16 = getelementptr inbounds double, double* %15, i64 1
%17 = load double, double* %16
%18 = fmul double %17, 0x404CA5DC1A63C1F8
%19 = call i32 (i32, i8*, double, double, ...) @trace(i32 3, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), double %14, double %18)
%20 = load double*, double** %5
%21 = getelementptr inbounds double, double* %20, i64 0
%22 = load double, double* %21
%23 = fdiv double %22, 0x3ED455A5B2FF8F9D
store double %23, double* %7
%24 = load double*, double** %5
%25 = getelementptr inbounds double, double* %24, i64 1
%26 = load double, double* %25
%27 = fdiv double %26, 0x3ED455A5B2FF8F9D
store double %27, double* %8
%28 = load double*, double** %4
%29 = getelementptr inbounds double, double* %28, i64 1
%30 = load double, double* %29
%31 = call i32 @cos(double %30)
%32 = sitofp i32 %31 to double
store double %32, double* %9
%33 = load double*, double** %4
%34 = getelementptr inbounds double, double* %33, i64 1
%35 = load double, double* %34
%36 = call i32 @sin(double %35)
%37 = sitofp i32 %36 to double
store double %37, double* %10
%38 = load double*, double** %4
%39 = getelementptr inbounds double, double* %38, i64 0
%40 = load double, double* %39
%41 = call i32 @sin(double %40)
%42 = sitofp i32 %41 to double
%43 = fmul double 0x3F826E978D4FDF3B, %42
%44 = load double, double* %7
%45 = load double, double* %10
%46 = load double, double* %8
%47 = load double, double* %9
%48 = fmul double %46, %47
%49 = call double @llvm.fmuladd.f64(double %44, double %45, double %48)
%50 = fmul double %43, %49
%51 = load double*, double** %6
%52 = getelementptr inbounds double, double* %51, i64 0
store double %50, double* %52
%53 = load double*, double** %4
%54 = getelementptr inbounds double, double* %53, i64 0
%55 = load double, double* %54
%56 = fmul double 2.000000e+00, %55
%57 = call i32 @cos(double %56)
%58 = sitofp i32 %57 to double
%59 = fmul double 0xBF826E978D4FDF3B, %58
%60 = load double, double* %7
%61 = load double, double* %9
%62 = load double, double* %8
%63 = load double, double* %10
%64 = fmul double %62, %63
%65 = fneg double %64
%66 = call double @llvm.fmuladd.f64(double %60, double %61, double %65)
%67 = fmul double %59, %66
%68 = load double*, double** %6
%69 = getelementptr inbounds double, double* %68, i64 1
store double %67, double* %69
%70 = load double*, double** %4
%71 = getelementptr inbounds double, double* %70, i64 0
%72 = load double, double* %71
%73 = fmul double 2.000000e+00, %72
%74 = call i32 @sin(double %73)
%75 = sitofp i32 %74 to double
%76 = fmul double -3.200000e-02, %75
%77 = load double, double* %7
%78 = load double, double* %9
%79 = load double, double* %8
%80 = load double, double* %10
%81 = fmul double %79, %80
%82 = fneg double %81
%83 = call double @llvm.fmuladd.f64(double %77, double %78, double %82)
%84 = fmul double %76, %83
%85 = load double*, double** %6
%86 = getelementptr inbounds double, double* %85, i64 2
store double %84, double* %86
%87 = load double*, double** %6
%88 = getelementptr inbounds double, double* %87, i64 0
%89 = load double, double* %88
%90 = load double*, double** %6
%91 = getelementptr inbounds double, double* %90, i64 1
%92 = load double, double* %91
%93 = load double*, double** %6
%94 = getelementptr inbounds double, double* %93, i64 2
%95 = load double, double* %94
%96 = call i32 (i32, i8*, double, double, ...) @trace(i32 5, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.1, i64 0, i64 0), double %89, double %92, double %95)
ret void
}

LLVM IR (-O2):
@.str = [26 x i8] c"tide_pole: pos=%.3f %.3f\0A\00"
@.str.1 = [33 x i8] c"tide_pole : denu=%.3f %.3f %.3f\0A\00"
define void @tide_pole(double* nocapture %0, double* nocapture %1, double* nocapture %2) {
%4 = load double, double* %0
%5 = fmul double %4, 0x404CA5DC1A63C1F8
%6 = getelementptr inbounds double, double* %0, i64 1
%7 = load double, double* %6
%8 = fmul double %7, 0x404CA5DC1A63C1F8
%9 = tail call i32 (i32, i8*, double, double, ...) @trace(i32 3, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), double %5, double %8)
%10 = load double, double* %1
%11 = fdiv double %10, 0x3ED455A5B2FF8F9D
%12 = getelementptr inbounds double, double* %1, i64 1
%13 = load double, double* %12
%14 = fdiv double %13, 0x3ED455A5B2FF8F9D
%15 = load double, double* %6
%16 = tail call i32 @cos(double %15)
%17 = sitofp i32 %16 to double
%18 = load double, double* %6
%19 = tail call i32 @sin(double %18)
%20 = sitofp i32 %19 to double
%21 = load double, double* %0
%22 = tail call i32 @sin(double %21)
%23 = sitofp i32 %22 to double
%24 = fmul double %23, 0x3F826E978D4FDF3B
%25 = fmul double %14, %17
%26 = tail call double @llvm.fmuladd.f64(double %11, double %20, double %25)
%27 = fmul double %26, %24
store double %27, double* %2
%28 = load double, double* %0
%29 = fmul double %28, 2.000000e+00
%30 = tail call i32 @cos(double %29)
%31 = sitofp i32 %30 to double
%32 = fmul double %31, 0xBF826E978D4FDF3B
%33 = fneg double %14
%34 = fmul double %33, %20
%35 = tail call double @llvm.fmuladd.f64(double %11, double %17, double %34)
%36 = fmul double %35, %32
%37 = getelementptr inbounds double, double* %2, i64 1
store double %36, double* %37
%38 = load double, double* %0
%39 = fmul double %38, 2.000000e+00
%40 = tail call i32 @sin(double %39)
%41 = sitofp i32 %40 to double
%42 = fmul double %41, -3.200000e-02
%43 = fmul double %35, %42
%44 = getelementptr inbounds double, double* %2, i64 2
store double %43, double* %44
%45 = load double, double* %2
%46 = load double, double* %37
%47 = tail call i32 (i32, i8*, double, double, ...) @trace(i32 5, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.1, i64 0, i64 0), double %45, double %46, double %43)
ret void
}