#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 omega(double, double, double, double);
double sin(double);
double v_t(double latitude, double a0, double a1, double a2) {
  double lat, theta;
  double A, B, C;
  double v_tan;
  if ((a0 == 0) && (a1 == 0) && (a2 == 0)) {
    A = 2.972;
    B = -0.484;
    C = -0.361;
  } else {
    A = a0;
    B = a1;
    C = a2;
  }
  lat = latitude * M_PI / 180.0;
  theta = M_PI / 2.0 - lat;
  v_tan = omega(lat, A, B, C) * 696000000.0 * sin(theta);
  return v_tan;
}


x86 assembly (clang, -O0):
<v_t>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  %xmm3,-0x20(%rbp)
movsd  -0x10(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    11b0 <v_t+0x90>
jp     11b0 <v_t+0x90>
movsd  -0x18(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    11b0 <v_t+0x90>
jp     11b0 <v_t+0x90>
movsd  -0x20(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    11b0 <v_t+0x90>
jp     11b0 <v_t+0x90>
movsd  0xe84(%rip),%xmm0
movsd  %xmm0,-0x38(%rbp)
movsd  0xe6f(%rip),%xmm0
movsd  %xmm0,-0x40(%rbp)
movsd  0xe5a(%rip),%xmm0
movsd  %xmm0,-0x48(%rbp)
jmp    11ce <v_t+0xae>
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x38(%rbp)
movsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x40(%rbp)
movsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x48(%rbp)
movsd  -0x8(%rbp),%xmm0
mov    0x2e0e(%rip),%rax
mulsd  (%rax),%xmm0
movsd  0xe42(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x28(%rbp)
mov    0x2df2(%rip),%rax
movsd  (%rax),%xmm0
movsd  0xe1e(%rip),%xmm1
divsd  %xmm1,%xmm0
subsd  -0x28(%rbp),%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  -0x28(%rbp),%xmm0
movsd  -0x38(%rbp),%xmm1
movsd  -0x40(%rbp),%xmm2
movsd  -0x48(%rbp),%xmm3
call   1030 <omega@plt>
movsd  0xde7(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x58(%rbp)
movsd  -0x30(%rbp),%xmm0
call   1040 <sin@plt>
movaps %xmm0,%xmm1
movsd  -0x58(%rbp),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x50(%rbp)
movsd  -0x50(%rbp),%xmm0
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<v_t>:
sub    $0x18,%rsp
xorpd  %xmm4,%xmm4
ucomisd %xmm4,%xmm1
setnp  %al
sete   %cl
and    %al,%cl
ucomisd %xmm4,%xmm2
setnp  %al
sete   %dl
and    %al,%dl
and    %cl,%dl
ucomisd %xmm4,%xmm3
setnp  %al
sete   %cl
and    %al,%cl
test   %cl,%dl
jne    11b0 <v_t+0x90>
jne    11ba <v_t+0x9a>
je     115e <v_t+0x3e>
movsd  0xeb2(%rip),%xmm1
mov    0x2e83(%rip),%rax
movsd  (%rax),%xmm4
mulsd  %xmm4,%xmm0
divsd  0xea3(%rip),%xmm0
mulsd  0xea3(%rip),%xmm4
subsd  %xmm0,%xmm4
movsd  %xmm4,0x10(%rsp)
call   1030 <omega@plt>
mulsd  0xe94(%rip),%xmm0
movsd  %xmm0,0x8(%rsp)
movsd  0x10(%rsp),%xmm0
call   1040 <sin@plt>
mulsd  0x8(%rsp),%xmm0
add    $0x18,%rsp
ret
movsd  0xe48(%rip),%xmm2
je     1154 <v_t+0x34>
movsd  0xe46(%rip),%xmm3
jne    1156 <v_t+0x36>
jmp    115e <v_t+0x3e>

LLVM IR (-O0):
@M_PI = global double 0.000000e+00
define double @v_t(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 double
%12 = alloca double
%13 = alloca double
%14 = alloca double
store double %0, double* %5
store double %1, double* %6
store double %2, double* %7
store double %3, double* %8
%15 = load double, double* %6
%16 = fcmp oeq double %15, 0.000000e+00
br i1 %16, label %17, label %24
17: ; preds = %4
%18 = load double, double* %7
%19 = fcmp oeq double %18, 0.000000e+00
br i1 %19, label %20, label %24
20: ; preds = %17
%21 = load double, double* %8
%22 = fcmp oeq double %21, 0.000000e+00
br i1 %22, label %23, label %24
23: ; preds = %20
store double 2.972000e+00, double* %11
store double -4.840000e-01, double* %12
store double -3.610000e-01, double* %13
br label %28
24: ; preds = %20, %17, %4
%25 = load double, double* %6
store double %25, double* %11
%26 = load double, double* %7
store double %26, double* %12
%27 = load double, double* %8
store double %27, double* %13
br label %28
28: ; preds = %24, %23
%29 = load double, double* %5
%30 = load double, double* @M_PI
%31 = fmul double %29, %30
%32 = fdiv double %31, 1.800000e+02
store double %32, double* %9
%33 = load double, double* @M_PI
%34 = fdiv double %33, 2.000000e+00
%35 = load double, double* %9
%36 = fsub double %34, %35
store double %36, double* %10
%37 = load double, double* %9
%38 = load double, double* %11
%39 = load double, double* %12
%40 = load double, double* %13
%41 = call double @omega(double %37, double %38, double %39, double %40)
%42 = fmul double %41, 6.960000e+08
%43 = load double, double* %10
%44 = call double @sin(double %43)
%45 = fmul double %42, %44
store double %45, double* %14
%46 = load double, double* %14
ret double %46
}

LLVM IR (-O2):
@M_PI = global double 0.000000e+00
define double @v_t(double %0, double %1, double %2, double %3) {
%5 = fcmp oeq double %1, 0.000000e+00
%6 = fcmp oeq double %2, 0.000000e+00
%7 = and i1 %5, %6
%8 = fcmp oeq double %3, 0.000000e+00
%9 = and i1 %7, %8
%10 = select i1 %9, double -4.840000e-01, double %2
%11 = select i1 %9, double -3.610000e-01, double %3
%12 = select i1 %9, double 2.972000e+00, double %1
%13 = load double, double* @M_PI
%14 = fmul double %13, %0
%15 = fdiv double %14, 1.800000e+02
%16 = fmul double %13, 5.000000e-01
%17 = fsub double %16, %15
%18 = tail call double @omega(double %15, double %12, double %10, double %11)
%19 = fmul double %18, 6.960000e+08
%20 = tail call double @sin(double %17)
%21 = fmul double %19, %20
ret double %21
}