#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 pow(double, double);
double pixel_area(double lat, double lon, double dpix) {
  double area;
  double ti, tf, pi, pf;
  double t, p;
  double da;
  da = M_PI / 180.0 * dpix / 2.0;
  if (lon < 0) {
    p = M_PI / 180.0 * (360 + lon);
  } else {
    p = M_PI / 180.0 * lon;
  }
  t = M_PI / 180.0 * (90.0 - lat);
  pi = p - da;
  pf = p + da;
  ti = t - da;
  tf = t + da;
  area = -1.0 * (pow(696000000.0, 2.0)) * (pf - pi) * (cos(tf) - cos(ti));
  return area;
}


x86 assembly (clang, -O0):
<pixel_area>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
mov    0x2eaa(%rip),%rax
movsd  (%rax),%xmm0
movsd  0xebe(%rip),%xmm1
divsd  %xmm1,%xmm0
mulsd  -0x18(%rbp),%xmm0
movsd  0xea5(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x58(%rbp)
xorps  %xmm0,%xmm0
ucomisd -0x10(%rbp),%xmm0
jbe    11a4 <pixel_area+0x84>
mov    0x2e6f(%rip),%rax
movsd  (%rax),%xmm0
movsd  0xe83(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  0xe7f(%rip),%xmm1
addsd  -0x10(%rbp),%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x50(%rbp)
jmp    11c5 <pixel_area+0xa5>
mov    0x2e3d(%rip),%rax
movsd  (%rax),%xmm0
movsd  0xe51(%rip),%xmm1
divsd  %xmm1,%xmm0
mulsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x50(%rbp)
mov    0x2e1c(%rip),%rax
movsd  (%rax),%xmm0
movsd  0xe30(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  0xe44(%rip),%xmm1
subsd  -0x8(%rbp),%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x48(%rbp)
movsd  -0x50(%rbp),%xmm0
subsd  -0x58(%rbp),%xmm0
movsd  %xmm0,-0x38(%rbp)
movsd  -0x50(%rbp),%xmm0
addsd  -0x58(%rbp),%xmm0
movsd  %xmm0,-0x40(%rbp)
movsd  -0x48(%rbp),%xmm0
subsd  -0x58(%rbp),%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x48(%rbp),%xmm0
addsd  -0x58(%rbp),%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  0xdea(%rip),%xmm0
movsd  0xdc2(%rip),%xmm1
call   1040 <pow@plt>
movaps %xmm0,%xmm1
movsd  0xdca(%rip),%xmm0
mulsd  %xmm1,%xmm0
movsd  -0x40(%rbp),%xmm1
subsd  -0x38(%rbp),%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x60(%rbp)
movsd  -0x30(%rbp),%xmm0
call   1030 <cos@plt>
movsd  %xmm0,-0x68(%rbp)
movsd  -0x28(%rbp),%xmm0
call   1030 <cos@plt>
movsd  -0x68(%rbp),%xmm1
movaps %xmm0,%xmm2
movsd  -0x60(%rbp),%xmm0
subsd  %xmm2,%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x20(%rbp),%xmm0
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pixel_area>:
sub    $0x28,%rsp
mov    0x2ecd(%rip),%rax
movsd  (%rax),%xmm3
divsd  0xed9(%rip),%xmm3
mulsd  %xmm3,%xmm2
mulsd  0xed5(%rip),%xmm2
movsd  0xed5(%rip),%xmm4
addsd  %xmm1,%xmm4
xorpd  %xmm5,%xmm5
movapd %xmm1,%xmm6
cmpltsd %xmm5,%xmm6
andpd  %xmm6,%xmm4
andnpd %xmm1,%xmm6
orpd   %xmm4,%xmm6
mulsd  %xmm3,%xmm6
movsd  0xeb4(%rip),%xmm1
subsd  %xmm0,%xmm1
mulsd  %xmm3,%xmm1
movapd %xmm6,%xmm0
subsd  %xmm2,%xmm0
addsd  %xmm2,%xmm6
subsd  %xmm0,%xmm6
movapd %xmm1,%xmm0
subsd  %xmm2,%xmm0
movsd  %xmm0,0x8(%rsp)
addsd  %xmm2,%xmm1
mulsd  0xe8a(%rip),%xmm6
movapd %xmm6,0x10(%rsp)
movapd %xmm1,%xmm0
call   1030 <cos@plt>
movsd  %xmm0,(%rsp)
movsd  0x8(%rsp),%xmm0
call   1030 <cos@plt>
movsd  (%rsp),%xmm1
subsd  %xmm0,%xmm1
mulsd  0x10(%rsp),%xmm1
movapd %xmm1,%xmm0
add    $0x28,%rsp
ret

LLVM IR (-O0):
@M_PI = global double 0.000000e+00
define double @pixel_area(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
%11 = alloca double
%12 = alloca double
%13 = alloca double
%14 = alloca double
store double %0, double* %4
store double %1, double* %5
store double %2, double* %6
%15 = load double, double* @M_PI
%16 = fdiv double %15, 1.800000e+02
%17 = load double, double* %6
%18 = fmul double %16, %17
%19 = fdiv double %18, 2.000000e+00
store double %19, double* %14
%20 = load double, double* %5
%21 = fcmp olt double %20, 0.000000e+00
br i1 %21, label %22, label %28
22: ; preds = %3
%23 = load double, double* @M_PI
%24 = fdiv double %23, 1.800000e+02
%25 = load double, double* %5
%26 = fadd double 3.600000e+02, %25
%27 = fmul double %24, %26
store double %27, double* %13
br label %33
28: ; preds = %3
%29 = load double, double* @M_PI
%30 = fdiv double %29, 1.800000e+02
%31 = load double, double* %5
%32 = fmul double %30, %31
store double %32, double* %13
br label %33
33: ; preds = %28, %22
%34 = load double, double* @M_PI
%35 = fdiv double %34, 1.800000e+02
%36 = load double, double* %4
%37 = fsub double 9.000000e+01, %36
%38 = fmul double %35, %37
store double %38, double* %12
%39 = load double, double* %13
%40 = load double, double* %14
%41 = fsub double %39, %40
store double %41, double* %10
%42 = load double, double* %13
%43 = load double, double* %14
%44 = fadd double %42, %43
store double %44, double* %11
%45 = load double, double* %12
%46 = load double, double* %14
%47 = fsub double %45, %46
store double %47, double* %8
%48 = load double, double* %12
%49 = load double, double* %14
%50 = fadd double %48, %49
store double %50, double* %9
%51 = call double @pow(double 6.960000e+08, double 2.000000e+00)
%52 = fmul double -1.000000e+00, %51
%53 = load double, double* %11
%54 = load double, double* %10
%55 = fsub double %53, %54
%56 = fmul double %52, %55
%57 = load double, double* %9
%58 = call double @cos(double %57)
%59 = load double, double* %8
%60 = call double @cos(double %59)
%61 = fsub double %58, %60
%62 = fmul double %56, %61
store double %62, double* %7
%63 = load double, double* %7
ret double %63
}

LLVM IR (-O2):
@M_PI = global double 0.000000e+00
define double @pixel_area(double %0, double %1, double %2) {
%4 = load double, double* @M_PI
%5 = fdiv double %4, 1.800000e+02
%6 = fmul double %5, %2
%7 = fmul double %6, 5.000000e-01
%8 = fcmp olt double %1, 0.000000e+00
%9 = fadd double %1, 3.600000e+02
%10 = select i1 %8, double %9, double %1
%11 = fmul double %10, %5
%12 = fsub double 9.000000e+01, %0
%13 = fmul double %12, %5
%14 = fsub double %11, %7
%15 = fadd double %11, %7
%16 = fsub double %13, %7
%17 = fadd double %13, %7
%18 = fsub double %15, %14
%19 = fmul double %18, -4.844160e+17
%20 = tail call double @cos(double %17)
%21 = tail call double @cos(double %16)
%22 = fsub double %20, %21
%23 = fmul double %22, %19
ret double %23
}