#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 ceil(float);
double fabs(double);
int getSeasonDay(int, double);
double getSeasonalIsha(double lat, int day, double isha, double sunset) {
  float A, B, C, D;
  int DYY;
  double adjustedIsha;
  DYY = getSeasonDay(day, lat);
  A = 75 + 25.6 / 55.0 * fabs(lat);
  B = 75 + 2.05 / 55.0 * fabs(lat);
  C = 75 - 9.21 / 55.0 * fabs(lat);
  D = 75 + 6.14 / 55.0 * fabs(lat);
  if (DYY < 91) {
    A = A + (B - A) / 91.0 * DYY;
  } else if (DYY < 137) {
    A = B + (C - B) / 46.0 * (DYY - 91);
  } else if (DYY < 183) {
    A = C + (D - C) / 46.0 * (DYY - 137);
  } else if (DYY < 229) {
    A = D + (C - D) / 46.0 * (DYY - 183);
  } else if (DYY < 275) {
    A = C + (B - C) / 46.0 * (DYY - 229);
  } else if (DYY >= 275) {
    A = B + (A - B) / 91.0 * (DYY - 275);
  }
  adjustedIsha = sunset + (ceil(A) / 60.0);
  if (adjustedIsha < isha || isha == 99) {
    isha = adjustedIsha;
  }
  return isha;
}


x86 assembly (clang, -O0):
<getSeasonalIsha>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
movsd  %xmm0,-0x8(%rbp)
mov    %edi,-0xc(%rbp)
movsd  %xmm1,-0x18(%rbp)
movsd  %xmm2,-0x20(%rbp)
mov    -0xc(%rbp),%edi
movsd  -0x8(%rbp),%xmm0
call   1040 <getSeasonDay@plt>
mov    %eax,-0x34(%rbp)
movsd  -0x8(%rbp),%xmm0
movaps 0xefa(%rip),%xmm1
pand   %xmm1,%xmm0
movsd  0xebe(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xe9a(%rip),%xmm1
addsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x24(%rbp)
movsd  -0x8(%rbp),%xmm0
movaps 0xec9(%rip),%xmm1
pand   %xmm1,%xmm0
movsd  0xe85(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xe69(%rip),%xmm1
addsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x28(%rbp)
movsd  -0x8(%rbp),%xmm0
movaps 0xe98(%rip),%xmm1
pand   %xmm1,%xmm0
movsd  0xe4c(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xe38(%rip),%xmm1
addsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x2c(%rbp)
movsd  -0x8(%rbp),%xmm0
movaps 0xe67(%rip),%xmm1
pand   %xmm1,%xmm0
movsd  0xe0b(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xe07(%rip),%xmm1
addsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x30(%rbp)
cmpl   $0x5b,-0x34(%rbp)
jge    1256 <getSeasonalIsha+0x136>
movss  -0x24(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
movss  -0x28(%rbp),%xmm0
subss  -0x24(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xdf1(%rip),%xmm2
divsd  %xmm2,%xmm0
cvtsi2sdl -0x34(%rbp),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x24(%rbp)
jmp    1402 <getSeasonalIsha+0x2e2>
cmpl   $0x89,-0x34(%rbp)
jge    12a6 <getSeasonalIsha+0x186>
movss  -0x28(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
movss  -0x2c(%rbp),%xmm0
subss  -0x28(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xdae(%rip),%xmm2
divsd  %xmm2,%xmm0
mov    -0x34(%rbp),%eax
sub    $0x5b,%eax
cvtsi2sd %eax,%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x24(%rbp)
jmp    13fd <getSeasonalIsha+0x2dd>
cmpl   $0xb7,-0x34(%rbp)
jge    12f8 <getSeasonalIsha+0x1d8>
movss  -0x2c(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
movss  -0x30(%rbp),%xmm0
subss  -0x2c(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xd5e(%rip),%xmm2
divsd  %xmm2,%xmm0
mov    -0x34(%rbp),%eax
sub    $0x89,%eax
cvtsi2sd %eax,%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x24(%rbp)
jmp    13f8 <getSeasonalIsha+0x2d8>
cmpl   $0xe5,-0x34(%rbp)
jge    134a <getSeasonalIsha+0x22a>
movss  -0x30(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
movss  -0x2c(%rbp),%xmm0
subss  -0x30(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xd0c(%rip),%xmm2
divsd  %xmm2,%xmm0
mov    -0x34(%rbp),%eax
sub    $0xb7,%eax
cvtsi2sd %eax,%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x24(%rbp)
jmp    13f3 <getSeasonalIsha+0x2d3>
cmpl   $0x113,-0x34(%rbp)
jge    139c <getSeasonalIsha+0x27c>
movss  -0x2c(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
movss  -0x28(%rbp),%xmm0
subss  -0x2c(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xcba(%rip),%xmm2
divsd  %xmm2,%xmm0
mov    -0x34(%rbp),%eax
sub    $0xe5,%eax
cvtsi2sd %eax,%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x24(%rbp)
jmp    13ee <getSeasonalIsha+0x2ce>
cmpl   $0x113,-0x34(%rbp)
jl     13e9 <getSeasonalIsha+0x2c9>
movss  -0x28(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
movss  -0x24(%rbp),%xmm0
subss  -0x28(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xc60(%rip),%xmm2
divsd  %xmm2,%xmm0
mov    -0x34(%rbp),%eax
sub    $0x113,%eax
cvtsi2sd %eax,%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x24(%rbp)
jmp    13ee <getSeasonalIsha+0x2ce>
jmp    13f3 <getSeasonalIsha+0x2d3>
jmp    13f8 <getSeasonalIsha+0x2d8>
jmp    13fd <getSeasonalIsha+0x2dd>
jmp    1402 <getSeasonalIsha+0x2e2>
movsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x48(%rbp)
movss  -0x24(%rbp),%xmm0
call   1030 <ceil@plt>
movaps %xmm0,%xmm1
movsd  -0x48(%rbp),%xmm0
movsd  0xc12(%rip),%xmm2
divsd  %xmm2,%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x40(%rbp)
movsd  -0x40(%rbp),%xmm1
movsd  -0x18(%rbp),%xmm0
ucomisd %xmm1,%xmm0
ja     1464 <getSeasonalIsha+0x344>
movsd  -0x18(%rbp),%xmm0
movsd  0xbec(%rip),%xmm1
ucomisd %xmm1,%xmm0
jne    146e <getSeasonalIsha+0x34e>
jp     146e <getSeasonalIsha+0x34e>
movsd  -0x40(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getSeasonalIsha>:
sub    $0x28,%rsp
movsd  %xmm2,(%rsp)
movsd  %xmm1,0x8(%rsp)
movaps %xmm0,0x10(%rsp)
call   1040 <getSeasonDay@plt>
movapd 0x10(%rsp),%xmm4
andpd  0xeb9(%rip),%xmm4
movsd  0xec1(%rip),%xmm0
mulsd  %xmm4,%xmm0
movsd  0xebd(%rip),%xmm3
addsd  %xmm3,%xmm0
xorps  %xmm1,%xmm1
cvtsd2ss %xmm0,%xmm1
movsd  0xeb2(%rip),%xmm0
mulsd  %xmm4,%xmm0
addsd  %xmm3,%xmm0
cvtsd2ss %xmm0,%xmm0
cmp    $0x5a,%eax
jg     11ad <getSeasonalIsha+0x8d>
xorps  %xmm2,%xmm2
cvtss2sd %xmm1,%xmm2
subss  %xmm1,%xmm0
xorps  %xmm1,%xmm1
cvtss2sd %xmm0,%xmm1
divsd  0xe9f(%rip),%xmm1
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
mulsd  %xmm1,%xmm0
addsd  %xmm2,%xmm0
jmp    127c <getSeasonalIsha+0x15c>
movsd  0xe73(%rip),%xmm2
mulsd  %xmm4,%xmm2
addsd  %xmm3,%xmm2
cvtsd2ss %xmm2,%xmm2
cmp    $0x88,%eax
ja     11e7 <getSeasonalIsha+0xc7>
xorps  %xmm1,%xmm1
cvtss2sd %xmm0,%xmm1
subss  %xmm0,%xmm2
cvtss2sd %xmm2,%xmm2
divsd  0xe61(%rip),%xmm2
add    $0xffffffa5,%eax
jmp    126d <getSeasonalIsha+0x14d>
mulsd  0xe41(%rip),%xmm4
addsd  %xmm3,%xmm4
xorps  %xmm3,%xmm3
cvtsd2ss %xmm4,%xmm3
cmp    $0xb6,%eax
ja     1222 <getSeasonalIsha+0x102>
xorps  %xmm1,%xmm1
cvtss2sd %xmm2,%xmm1
subss  %xmm2,%xmm3
xorps  %xmm2,%xmm2
cvtss2sd %xmm3,%xmm2
divsd  0xe25(%rip),%xmm2
add    $0xffffff77,%eax
jmp    126d <getSeasonalIsha+0x14d>
cmp    $0xe4,%eax
ja     1247 <getSeasonalIsha+0x127>
xorps  %xmm1,%xmm1
cvtss2sd %xmm3,%xmm1
subss  %xmm3,%xmm2
cvtss2sd %xmm2,%xmm2
divsd  0xe00(%rip),%xmm2
add    $0xffffff49,%eax
jmp    126d <getSeasonalIsha+0x14d>
cmp    $0x112,%eax
ja     12c2 <getSeasonalIsha+0x1a2>
xorps  %xmm1,%xmm1
cvtss2sd %xmm2,%xmm1
subss  %xmm2,%xmm0
xorps  %xmm2,%xmm2
cvtss2sd %xmm0,%xmm2
divsd  0xdd8(%rip),%xmm2
add    $0xffffff1b,%eax
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
call   1030 <ceil@plt>
divsd  0xdbb(%rip),%xmm0
addsd  (%rsp),%xmm0
movsd  0xdb6(%rip),%xmm1
movsd  0x8(%rsp),%xmm3
cmpeqsd %xmm3,%xmm1
movapd %xmm1,%xmm2
andpd  %xmm0,%xmm2
minsd  %xmm3,%xmm0
andnpd %xmm0,%xmm1
orpd   %xmm2,%xmm1
movapd %xmm1,%xmm0
add    $0x28,%rsp
ret
xorps  %xmm2,%xmm2
cvtss2sd %xmm0,%xmm2
subss  %xmm0,%xmm1
cvtss2sd %xmm1,%xmm1
divsd  0xd5f(%rip),%xmm1
add    $0xfffffeed,%eax
jmp    1199 <getSeasonalIsha+0x79>

LLVM IR (-O0):
define double @getSeasonalIsha(double %0, i32 %1, double %2, double %3) {
%5 = alloca double
%6 = alloca i32
%7 = alloca double
%8 = alloca double
%9 = alloca float
%10 = alloca float
%11 = alloca float
%12 = alloca float
%13 = alloca i32
%14 = alloca double
store double %0, double* %5
store i32 %1, i32* %6
store double %2, double* %7
store double %3, double* %8
%15 = load i32, i32* %6
%16 = load double, double* %5
%17 = call i32 @getSeasonDay(i32 %15, double %16)
store i32 %17, i32* %13
%18 = load double, double* %5
%19 = call double @llvm.fabs.f64(double %18)
%20 = call double @llvm.fmuladd.f64(double 0x3FDDCA01DCA01DCA, double %19, double 7.500000e+01)
%21 = fptrunc double %20 to float
store float %21, float* %9
%22 = load double, double* %5
%23 = call double @llvm.fabs.f64(double %22)
%24 = call double @llvm.fmuladd.f64(double 0x3FA3156931569315, double %23, double 7.500000e+01)
%25 = fptrunc double %24 to float
store float %25, float* %10
%26 = load double, double* %5
%27 = call double @llvm.fabs.f64(double %26)
%28 = call double @llvm.fmuladd.f64(double 0xBFC56F268A259BD6, double %27, double 7.500000e+01)
%29 = fptrunc double %28 to float
store float %29, float* %11
%30 = load double, double* %5
%31 = call double @llvm.fabs.f64(double %30)
%32 = call double @llvm.fmuladd.f64(double 0x3FBC943362DCCFC7, double %31, double 7.500000e+01)
%33 = fptrunc double %32 to float
store float %33, float* %12
%34 = load i32, i32* %13
%35 = icmp slt i32 %34, 91
br i1 %35, label %36, label %48
36: ; preds = %4
%37 = load float, float* %9
%38 = fpext float %37 to double
%39 = load float, float* %10
%40 = load float, float* %9
%41 = fsub float %39, %40
%42 = fpext float %41 to double
%43 = fdiv double %42, 9.100000e+01
%44 = load i32, i32* %13
%45 = sitofp i32 %44 to double
%46 = call double @llvm.fmuladd.f64(double %43, double %45, double %38)
%47 = fptrunc double %46 to float
store float %47, float* %9
br label %133
48: ; preds = %4
%49 = load i32, i32* %13
%50 = icmp slt i32 %49, 137
br i1 %50, label %51, label %64
51: ; preds = %48
%52 = load float, float* %10
%53 = fpext float %52 to double
%54 = load float, float* %11
%55 = load float, float* %10
%56 = fsub float %54, %55
%57 = fpext float %56 to double
%58 = fdiv double %57, 4.600000e+01
%59 = load i32, i32* %13
%60 = sub nsw i32 %59, 91
%61 = sitofp i32 %60 to double
%62 = call double @llvm.fmuladd.f64(double %58, double %61, double %53)
%63 = fptrunc double %62 to float
store float %63, float* %9
br label %132
64: ; preds = %48
%65 = load i32, i32* %13
%66 = icmp slt i32 %65, 183
br i1 %66, label %67, label %80
67: ; preds = %64
%68 = load float, float* %11
%69 = fpext float %68 to double
%70 = load float, float* %12
%71 = load float, float* %11
%72 = fsub float %70, %71
%73 = fpext float %72 to double
%74 = fdiv double %73, 4.600000e+01
%75 = load i32, i32* %13
%76 = sub nsw i32 %75, 137
%77 = sitofp i32 %76 to double
%78 = call double @llvm.fmuladd.f64(double %74, double %77, double %69)
%79 = fptrunc double %78 to float
store float %79, float* %9
br label %131
80: ; preds = %64
%81 = load i32, i32* %13
%82 = icmp slt i32 %81, 229
br i1 %82, label %83, label %96
83: ; preds = %80
%84 = load float, float* %12
%85 = fpext float %84 to double
%86 = load float, float* %11
%87 = load float, float* %12
%88 = fsub float %86, %87
%89 = fpext float %88 to double
%90 = fdiv double %89, 4.600000e+01
%91 = load i32, i32* %13
%92 = sub nsw i32 %91, 183
%93 = sitofp i32 %92 to double
%94 = call double @llvm.fmuladd.f64(double %90, double %93, double %85)
%95 = fptrunc double %94 to float
store float %95, float* %9
br label %130
96: ; preds = %80
%97 = load i32, i32* %13
%98 = icmp slt i32 %97, 275
br i1 %98, label %99, label %112
99: ; preds = %96
%100 = load float, float* %11
%101 = fpext float %100 to double
%102 = load float, float* %10
%103 = load float, float* %11
%104 = fsub float %102, %103
%105 = fpext float %104 to double
%106 = fdiv double %105, 4.600000e+01
%107 = load i32, i32* %13
%108 = sub nsw i32 %107, 229
%109 = sitofp i32 %108 to double
%110 = call double @llvm.fmuladd.f64(double %106, double %109, double %101)
%111 = fptrunc double %110 to float
store float %111, float* %9
br label %129
112: ; preds = %96
%113 = load i32, i32* %13
%114 = icmp sge i32 %113, 275
br i1 %114, label %115, label %128
115: ; preds = %112
%116 = load float, float* %10
%117 = fpext float %116 to double
%118 = load float, float* %9
%119 = load float, float* %10
%120 = fsub float %118, %119
%121 = fpext float %120 to double
%122 = fdiv double %121, 9.100000e+01
%123 = load i32, i32* %13
%124 = sub nsw i32 %123, 275
%125 = sitofp i32 %124 to double
%126 = call double @llvm.fmuladd.f64(double %122, double %125, double %117)
%127 = fptrunc double %126 to float
store float %127, float* %9
br label %128
128: ; preds = %115, %112
br label %129
129: ; preds = %128, %99
br label %130
130: ; preds = %129, %83
br label %131
131: ; preds = %130, %67
br label %132
132: ; preds = %131, %51
br label %133
133: ; preds = %132, %36
%134 = load double, double* %8
%135 = load float, float* %9
%136 = call double @ceil(float %135)
%137 = fdiv double %136, 6.000000e+01
%138 = fadd double %134, %137
store double %138, double* %14
%139 = load double, double* %14
%140 = load double, double* %7
%141 = fcmp olt double %139, %140
br i1 %141, label %145, label %142
142: ; preds = %133
%143 = load double, double* %7
%144 = fcmp oeq double %143, 9.900000e+01
br i1 %144, label %145, label %147
145: ; preds = %142, %133
%146 = load double, double* %14
store double %146, double* %7
br label %147
147: ; preds = %145, %142
%148 = load double, double* %7
ret double %148
}

LLVM IR (-O2):
define double @getSeasonalIsha(double %0, i32 %1, double %2, double %3) {
%5 = tail call i32 @getSeasonDay(i32 %1, double %0)
%6 = tail call double @llvm.fabs.f64(double %0)
%7 = tail call double @llvm.fmuladd.f64(double %6, double 0x3FDDCA01DCA01DCA, double 7.500000e+01)
%8 = fptrunc double %7 to float
%9 = tail call double @llvm.fmuladd.f64(double %6, double 0x3FA3156931569315, double 7.500000e+01)
%10 = fptrunc double %9 to float
%11 = tail call double @llvm.fmuladd.f64(double %6, double 0xBFC56F268A259BD6, double 7.500000e+01)
%12 = fptrunc double %11 to float
%13 = tail call double @llvm.fmuladd.f64(double %6, double 0x3FBC943362DCCFC7, double 7.500000e+01)
%14 = fptrunc double %13 to float
%15 = icmp slt i32 %5, 91
br i1 %15, label %16, label %23
16: ; preds = %4
%17 = fpext float %8 to double
%18 = fsub float %10, %8
%19 = fpext float %18 to double
%20 = fdiv double %19, 9.100000e+01
%21 = sitofp i32 %5 to double
%22 = tail call double @llvm.fmuladd.f64(double %20, double %21, double %17)
br label %71
23: ; preds = %4
%24 = icmp ult i32 %5, 137
br i1 %24, label %25, label %33
25: ; preds = %23
%26 = fpext float %10 to double
%27 = fsub float %12, %10
%28 = fpext float %27 to double
%29 = fdiv double %28, 4.600000e+01
%30 = add nsw i32 %5, -91
%31 = sitofp i32 %30 to double
%32 = tail call double @llvm.fmuladd.f64(double %29, double %31, double %26)
br label %71
33: ; preds = %23
%34 = icmp ult i32 %5, 183
br i1 %34, label %35, label %43
35: ; preds = %33
%36 = fpext float %12 to double
%37 = fsub float %14, %12
%38 = fpext float %37 to double
%39 = fdiv double %38, 4.600000e+01
%40 = add nsw i32 %5, -137
%41 = sitofp i32 %40 to double
%42 = tail call double @llvm.fmuladd.f64(double %39, double %41, double %36)
br label %71
43: ; preds = %33
%44 = icmp ult i32 %5, 229
br i1 %44, label %45, label %53
45: ; preds = %43
%46 = fpext float %14 to double
%47 = fsub float %12, %14
%48 = fpext float %47 to double
%49 = fdiv double %48, 4.600000e+01
%50 = add nsw i32 %5, -183
%51 = sitofp i32 %50 to double
%52 = tail call double @llvm.fmuladd.f64(double %49, double %51, double %46)
br label %71
53: ; preds = %43
%54 = icmp ult i32 %5, 275
br i1 %54, label %55, label %63
55: ; preds = %53
%56 = fpext float %12 to double
%57 = fsub float %10, %12
%58 = fpext float %57 to double
%59 = fdiv double %58, 4.600000e+01
%60 = add nsw i32 %5, -229
%61 = sitofp i32 %60 to double
%62 = tail call double @llvm.fmuladd.f64(double %59, double %61, double %56)
br label %71
63: ; preds = %53
%64 = fpext float %10 to double
%65 = fsub float %8, %10
%66 = fpext float %65 to double
%67 = fdiv double %66, 9.100000e+01
%68 = add nsw i32 %5, -275
%69 = sitofp i32 %68 to double
%70 = tail call double @llvm.fmuladd.f64(double %67, double %69, double %64)
br label %71
71: ; preds = %25, %45, %63, %55, %35, %16
%72 = phi double [ %22, %16 ], [ %32, %25 ], [ %42, %35 ], [ %52, %45 ], [ %62, %55 ], [ %70, %63 ]
%73 = fptrunc double %72 to float
%74 = tail call double @ceil(float %73)
%75 = fdiv double %74, 6.000000e+01
%76 = fadd double %75, %3
%77 = fcmp olt double %76, %2
%78 = fcmp oeq double %2, 9.900000e+01
%79 = or i1 %78, %77
%80 = select i1 %79, double %76, double %2
ret double %80
}