#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;
int /*<<< orphan*/ pomme_external_geocentric(int *, double, double, double,
                                             double, double, double, double,
                                             double, double, double *, double *,
                                             double *);
int /*<<< orphan*/ pomme_internal_geocentric(int, double, double, double,
                                             double, double *, double *,
                                             double *, double *, double *,
                                             double *);
void pomme_geocentric(int control[17], double fday, double r, double lat,
                      double lon, double est, double ist, double imf_by,
                      double f107, double Em, double *x, double *y, double *z) {
  double theta, phi, lat_rad, rrel;
  double mx, my, mz, cx, cy, cz, ex, ey, ez, fyear;
  lat_rad = lat * M_PI / 180.0;
  theta = M_PI / 2.0 - lat_rad;
  phi = lon * M_PI / 180.0;
  fyear = 2000.0 + fday / 365.25;
  pomme_internal_geocentric(control[0], fyear, r, theta, phi, &mx, &my, &mz,
                            &cx, &cy, &cz);
  rrel = r / 6371.2;
  pomme_external_geocentric(control, fday, rrel, theta, phi, est, ist, imf_by,
                            f107, Em, &ex, &ey, &ez);
  *x = mx + cx + ex;
  *y = my + cy + ey;
  *z = mz + cz + ez;
  return;
}


x86 assembly (clang, -O0):
<pomme_geocentric>:
push   %rbp
mov    %rsp,%rbp
sub    $0xe0,%rsp
movsd  0x10(%rbp),%xmm8
mov    %rdi,-0x8(%rbp)
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x18(%rbp)
movsd  %xmm2,-0x20(%rbp)
movsd  %xmm3,-0x28(%rbp)
movsd  %xmm4,-0x30(%rbp)
movsd  %xmm5,-0x38(%rbp)
movsd  %xmm6,-0x40(%rbp)
movsd  %xmm7,-0x48(%rbp)
mov    %rsi,-0x50(%rbp)
mov    %rdx,-0x58(%rbp)
mov    %rcx,-0x60(%rbp)
movsd  -0x20(%rbp),%xmm0
mov    0x2e73(%rip),%rax
mulsd  (%rax),%xmm0
movsd  0xe97(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x78(%rbp)
mov    0x2e57(%rip),%rax
movsd  (%rax),%xmm0
movsd  0xe83(%rip),%xmm1
divsd  %xmm1,%xmm0
subsd  -0x78(%rbp),%xmm0
movsd  %xmm0,-0x68(%rbp)
movsd  -0x28(%rbp),%xmm0
mov    0x2e31(%rip),%rax
mulsd  (%rax),%xmm0
movsd  0xe55(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x70(%rbp)
movsd  -0x10(%rbp),%xmm1
movsd  0xe37(%rip),%xmm0
divsd  %xmm0,%xmm1
movsd  0xe23(%rip),%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0xd0(%rbp)
ff
mov    -0x8(%rbp),%rax
mov    (%rax),%edi
movsd  -0xd0(%rbp),%xmm0
ff
movsd  -0x18(%rbp),%xmm1
movsd  -0x68(%rbp),%xmm2
movsd  -0x70(%rbp),%xmm3
lea    -0x88(%rbp),%rsi
lea    -0x90(%rbp),%rdx
lea    -0x98(%rbp),%rcx
lea    -0xa0(%rbp),%r8
lea    -0xa8(%rbp),%r9
lea    -0xb0(%rbp),%rax
mov    %rax,(%rsp)
call   1040 <pomme_internal_geocentric@plt>
movsd  -0x18(%rbp),%xmm0
movsd  0xdb2(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x80(%rbp)
mov    -0x8(%rbp),%rdi
movsd  -0x10(%rbp),%xmm0
movsd  -0x80(%rbp),%xmm1
movsd  -0x68(%rbp),%xmm2
movsd  -0x70(%rbp),%xmm3
movsd  -0x30(%rbp),%xmm4
movsd  -0x38(%rbp),%xmm5
movsd  -0x40(%rbp),%xmm6
movsd  -0x48(%rbp),%xmm7
movsd  0x10(%rbp),%xmm8
lea    -0xb8(%rbp),%rsi
lea    -0xc0(%rbp),%rdx
lea    -0xc8(%rbp),%rcx
movsd  %xmm8,(%rsp)
call   1030 <pomme_external_geocentric@plt>
movsd  -0x88(%rbp),%xmm0
ff
addsd  -0xa0(%rbp),%xmm0
ff
addsd  -0xb8(%rbp),%xmm0
ff
mov    -0x50(%rbp),%rax
movsd  %xmm0,(%rax)
movsd  -0x90(%rbp),%xmm0
ff
addsd  -0xa8(%rbp),%xmm0
ff
addsd  -0xc0(%rbp),%xmm0
ff
mov    -0x58(%rbp),%rax
movsd  %xmm0,(%rax)
movsd  -0x98(%rbp),%xmm0
ff
addsd  -0xb0(%rbp),%xmm0
ff
addsd  -0xc8(%rbp),%xmm0
mov    -0x60(%rbp),%rax
movsd  %xmm0,(%rax)
add    $0xe0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pomme_geocentric>:
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x98,%rsp
mov    %rcx,%r14
mov    %rdx,%r15
mov    %rsi,%r12
movsd  %xmm7,0x48(%rsp)
movsd  %xmm6,0x40(%rsp)
movsd  %xmm5,0x38(%rsp)
movsd  %xmm4,0x30(%rsp)
movsd  %xmm1,0x10(%rsp)
movsd  %xmm0,0x28(%rsp)
mov    %rdi,%rbx
mov    0x2e83(%rip),%rax
movsd  (%rax),%xmm4
mulsd  %xmm4,%xmm2
movsd  0xe8b(%rip),%xmm5
divsd  %xmm5,%xmm2
movsd  0xe87(%rip),%xmm6
mulsd  %xmm4,%xmm6
subsd  %xmm2,%xmm6
movapd %xmm6,%xmm2
movsd  %xmm6,0x20(%rsp)
mulsd  %xmm4,%xmm3
divsd  0xe71(%rip),%xmm0
divsd  %xmm5,%xmm3
movsd  %xmm3,0x18(%rsp)
addsd  0xe67(%rip),%xmm0
mov    (%rdi),%edi
lea    0x68(%rsp),%rax
mov    %rax,(%rsp)
lea    0x90(%rsp),%rsi
lea    0x88(%rsp),%rdx
lea    0x80(%rsp),%rcx
lea    0x78(%rsp),%r8
lea    0x70(%rsp),%r9
call   1040 <pomme_internal_geocentric@plt>
movsd  0x10(%rsp),%xmm1
divsd  0xe2f(%rip),%xmm1
movsd  0xc0(%rsp),%xmm0
movsd  %xmm0,(%rsp)
lea    0x60(%rsp),%rsi
lea    0x58(%rsp),%rdx
lea    0x50(%rsp),%rcx
mov    %rbx,%rdi
movsd  0x28(%rsp),%xmm0
movsd  0x20(%rsp),%xmm2
movsd  0x18(%rsp),%xmm3
movsd  0x30(%rsp),%xmm4
movsd  0x38(%rsp),%xmm5
movsd  0x40(%rsp),%xmm6
movsd  0x48(%rsp),%xmm7
call   1030 <pomme_external_geocentric@plt>
movsd  0x90(%rsp),%xmm0
addsd  0x78(%rsp),%xmm0
addsd  0x60(%rsp),%xmm0
movsd  %xmm0,(%r12)
movsd  0x88(%rsp),%xmm0
addsd  0x70(%rsp),%xmm0
addsd  0x58(%rsp),%xmm0
movsd  %xmm0,(%r15)
movsd  0x80(%rsp),%xmm0
addsd  0x68(%rsp),%xmm0
addsd  0x50(%rsp),%xmm0
movsd  %xmm0,(%r14)
add    $0x98,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@M_PI = global double 0.000000e+00
define void @pomme_geocentric(i32* %0, double %1, double %2, double %3, double %4, double %5, double %6, double %7, double %8, double %9, double* %10, double* %11, double* %12) {
%14 = alloca i32*
%15 = alloca double
%16 = alloca double
%17 = alloca double
%18 = alloca double
%19 = alloca double
%20 = alloca double
%21 = alloca double
%22 = alloca double
%23 = alloca double
%24 = alloca double*
%25 = alloca double*
%26 = alloca double*
%27 = alloca double
%28 = alloca double
%29 = alloca double
%30 = alloca double
%31 = alloca double
%32 = alloca double
%33 = alloca double
%34 = alloca double
%35 = alloca double
%36 = alloca double
%37 = alloca double
%38 = alloca double
%39 = alloca double
%40 = alloca double
store i32* %0, i32** %14
store double %1, double* %15
store double %2, double* %16
store double %3, double* %17
store double %4, double* %18
store double %5, double* %19
store double %6, double* %20
store double %7, double* %21
store double %8, double* %22
store double %9, double* %23
store double* %10, double** %24
store double* %11, double** %25
store double* %12, double** %26
%41 = load double, double* %17
%42 = load double, double* @M_PI
%43 = fmul double %41, %42
%44 = fdiv double %43, 1.800000e+02
store double %44, double* %29
%45 = load double, double* @M_PI
%46 = fdiv double %45, 2.000000e+00
%47 = load double, double* %29
%48 = fsub double %46, %47
store double %48, double* %27
%49 = load double, double* %18
%50 = load double, double* @M_PI
%51 = fmul double %49, %50
%52 = fdiv double %51, 1.800000e+02
store double %52, double* %28
%53 = load double, double* %15
%54 = fdiv double %53, 3.652500e+02
%55 = fadd double 2.000000e+03, %54
store double %55, double* %40
%56 = load i32*, i32** %14
%57 = getelementptr inbounds i32, i32* %56, i64 0
%58 = load i32, i32* %57
%59 = load double, double* %40
%60 = load double, double* %16
%61 = load double, double* %27
%62 = load double, double* %28
%63 = call i32 @pomme_internal_geocentric(i32 %58, double %59, double %60, double %61, double %62, double* %31, double* %32, double* %33, double* %34, double* %35, double* %36)
%64 = load double, double* %16
%65 = fdiv double %64, 6.371200e+03
store double %65, double* %30
%66 = load i32*, i32** %14
%67 = load double, double* %15
%68 = load double, double* %30
%69 = load double, double* %27
%70 = load double, double* %28
%71 = load double, double* %19
%72 = load double, double* %20
%73 = load double, double* %21
%74 = load double, double* %22
%75 = load double, double* %23
%76 = call i32 @pomme_external_geocentric(i32* %66, double %67, double %68, double %69, double %70, double %71, double %72, double %73, double %74, double %75, double* %37, double* %38, double* %39)
%77 = load double, double* %31
%78 = load double, double* %34
%79 = fadd double %77, %78
%80 = load double, double* %37
%81 = fadd double %79, %80
%82 = load double*, double** %24
store double %81, double* %82
%83 = load double, double* %32
%84 = load double, double* %35
%85 = fadd double %83, %84
%86 = load double, double* %38
%87 = fadd double %85, %86
%88 = load double*, double** %25
store double %87, double* %88
%89 = load double, double* %33
%90 = load double, double* %36
%91 = fadd double %89, %90
%92 = load double, double* %39
%93 = fadd double %91, %92
%94 = load double*, double** %26
store double %93, double* %94
ret void
}

LLVM IR (-O2):
@M_PI = global double 0.000000e+00
define void @pomme_geocentric(i32* %0, double %1, double %2, double %3, double %4, double %5, double %6, double %7, double %8, double %9, double* nocapture writeonly %10, double* nocapture writeonly %11, double* nocapture writeonly %12) {
%14 = alloca double
%15 = alloca double
%16 = alloca double
%17 = alloca double
%18 = alloca double
%19 = alloca double
%20 = alloca double
%21 = alloca double
%22 = alloca double
%23 = bitcast double* %14 to i8*
%24 = bitcast double* %15 to i8*
%25 = bitcast double* %16 to i8*
%26 = bitcast double* %17 to i8*
%27 = bitcast double* %18 to i8*
%28 = bitcast double* %19 to i8*
%29 = bitcast double* %20 to i8*
%30 = bitcast double* %21 to i8*
%31 = bitcast double* %22 to i8*
%32 = load double, double* @M_PI
%33 = fmul double %32, %3
%34 = fdiv double %33, 1.800000e+02
%35 = fmul double %32, 5.000000e-01
%36 = fsub double %35, %34
%37 = fmul double %32, %4
%38 = fdiv double %37, 1.800000e+02
%39 = fdiv double %1, 3.652500e+02
%40 = fadd double %39, 2.000000e+03
%41 = load i32, i32* %0
%42 = call i32 @pomme_internal_geocentric(i32 %41, double %40, double %2, double %36, double %38, double* %14, double* %15, double* %16, double* %17, double* %18, double* %19)
%43 = fdiv double %2, 6.371200e+03
%44 = call i32 @pomme_external_geocentric(i32* %0, double %1, double %43, double %36, double %38, double %5, double %6, double %7, double %8, double %9, double* %20, double* %21, double* %22)
%45 = load double, double* %14
%46 = load double, double* %17
%47 = fadd double %45, %46
%48 = load double, double* %20
%49 = fadd double %47, %48
store double %49, double* %10
%50 = load double, double* %15
%51 = load double, double* %18
%52 = fadd double %50, %51
%53 = load double, double* %21
%54 = fadd double %52, %53
store double %54, double* %11
%55 = load double, double* %16
%56 = load double, double* %19
%57 = fadd double %55, %56
%58 = load double, double* %22
%59 = fadd double %57, %58
store double %59, double* %12
ret void
}