#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 Asc2(int, double, double, double);
int fabs(double);
double swe_degnorm(double);
double Asc1(double x1, double f, double sine, double cose) {
  int n;
  double ass;
  x1 = swe_degnorm(x1);
  n = (int)((x1 / 90) + 1);
  if (fabs(90 - f) < 1E-10) {
    return 180;
  }
  if (fabs(90 + f) < 1E-10) {
    return 0;
  }
  if (n == 1)
    ass = (Asc2(x1, f, sine, cose));
  else if (n == 2)
    ass = (180 - Asc2(180 - x1, -f, sine, cose));
  else if (n == 3)
    ass = (180 + Asc2(x1 - 180, -f, sine, cose));
  else
    ass = (360 - Asc2(360 - x1, f, sine, cose));
  ass = swe_degnorm(ass);
  if (fabs(ass - 90) < 1E-10)
    ass = 90;
  if (fabs(ass - 180) < 1E-10)
    ass = 180;
  if (fabs(ass - 270) < 1E-10)
    ass = 270;
  if (fabs(ass - 360) < 1E-10)
    ass = 0;
  return ass;
}


x86 assembly (clang, -O0):
<Asc1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x18(%rbp)
movsd  %xmm2,-0x20(%rbp)
movsd  %xmm3,-0x28(%rbp)
movsd  -0x10(%rbp),%xmm0
call   1030 <swe_degnorm@plt>
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  0xea0(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  0xe9c(%rip),%xmm1
addsd  %xmm1,%xmm0
cvttsd2si %xmm0,%eax
mov    %eax,-0x2c(%rbp)
movsd  0xe81(%rip),%xmm0
subsd  -0x18(%rbp),%xmm0
call   1040 <fabs@plt>
cvtsi2sd %eax,%xmm1
movsd  0xe63(%rip),%xmm0
ucomisd %xmm1,%xmm0
jbe    11b9 <Asc1+0x89>
movsd  0xe71(%rip),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    1412 <Asc1+0x2e2>
movsd  0xe47(%rip),%xmm0
addsd  -0x18(%rbp),%xmm0
call   1040 <fabs@plt>
cvtsi2sd %eax,%xmm1
movsd  0xe29(%rip),%xmm0
ucomisd %xmm1,%xmm0
jbe    11ee <Asc1+0xbe>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    1412 <Asc1+0x2e2>
cmpl   $0x1,-0x2c(%rbp)
jne    121f <Asc1+0xef>
cvttsd2si -0x10(%rbp),%edi
movsd  -0x18(%rbp),%xmm0
movsd  -0x20(%rbp),%xmm1
movsd  -0x28(%rbp),%xmm2
call   1050 <Asc2@plt>
cvtsi2sd %eax,%xmm0
movsd  %xmm0,-0x38(%rbp)
jmp    131a <Asc1+0x1ea>
cmpl   $0x2,-0x2c(%rbp)
jne    127c <Asc1+0x14c>
movsd  0xdef(%rip),%xmm0
subsd  -0x10(%rbp),%xmm0
cvttsd2si %xmm0,%edi
movsd  -0x18(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  -0x20(%rbp),%xmm1
movsd  -0x28(%rbp),%xmm2
call   1050 <Asc2@plt>
mov    %eax,%ecx
mov    $0xb4,%eax
sub    %ecx,%eax
cvtsi2sd %eax,%xmm0
movsd  %xmm0,-0x38(%rbp)
jmp    1315 <Asc1+0x1e5>
cmpl   $0x3,-0x2c(%rbp)
jne    12d9 <Asc1+0x1a9>
movsd  -0x10(%rbp),%xmm0
movsd  0xd8d(%rip),%xmm1
subsd  %xmm1,%xmm0
cvttsd2si %xmm0,%edi
movsd  -0x18(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  -0x20(%rbp),%xmm1
movsd  -0x28(%rbp),%xmm2
call   1050 <Asc2@plt>
add    $0xb4,%eax
cvtsi2sd %eax,%xmm0
movsd  %xmm0,-0x38(%rbp)
jmp    1310 <Asc1+0x1e0>
movsd  0xd37(%rip),%xmm0
subsd  -0x10(%rbp),%xmm0
cvttsd2si %xmm0,%edi
movsd  -0x18(%rbp),%xmm0
movsd  -0x20(%rbp),%xmm1
movsd  -0x28(%rbp),%xmm2
call   1050 <Asc2@plt>
mov    %eax,%ecx
mov    $0x168,%eax
sub    %ecx,%eax
cvtsi2sd %eax,%xmm0
movsd  %xmm0,-0x38(%rbp)
jmp    1315 <Asc1+0x1e5>
jmp    131a <Asc1+0x1ea>
movsd  -0x38(%rbp),%xmm0
call   1030 <swe_degnorm@plt>
movsd  %xmm0,-0x38(%rbp)
movsd  -0x38(%rbp),%xmm0
movsd  0xcd2(%rip),%xmm1
subsd  %xmm1,%xmm0
call   1040 <fabs@plt>
cvtsi2sd %eax,%xmm1
movsd  0xcb5(%rip),%xmm0
ucomisd %xmm1,%xmm0
jbe    1362 <Asc1+0x232>
movsd  0xcab(%rip),%xmm0
movsd  %xmm0,-0x38(%rbp)
movsd  -0x38(%rbp),%xmm0
movsd  0xcb1(%rip),%xmm1
subsd  %xmm1,%xmm0
call   1040 <fabs@plt>
cvtsi2sd %eax,%xmm1
movsd  0xc7c(%rip),%xmm0
ucomisd %xmm1,%xmm0
jbe    139b <Asc1+0x26b>
movsd  0xc8a(%rip),%xmm0
movsd  %xmm0,-0x38(%rbp)
movsd  -0x38(%rbp),%xmm0
movsd  0xc80(%rip),%xmm1
subsd  %xmm1,%xmm0
call   1040 <fabs@plt>
cvtsi2sd %eax,%xmm1
movsd  0xc43(%rip),%xmm0
ucomisd %xmm1,%xmm0
jbe    13d4 <Asc1+0x2a4>
movsd  0xc59(%rip),%xmm0
movsd  %xmm0,-0x38(%rbp)
movsd  -0x38(%rbp),%xmm0
movsd  0xc37(%rip),%xmm1
subsd  %xmm1,%xmm0
call   1040 <fabs@plt>
cvtsi2sd %eax,%xmm1
movsd  0xc0a(%rip),%xmm0
ucomisd %xmm1,%xmm0
jbe    1408 <Asc1+0x2d8>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x38(%rbp)
movsd  -0x38(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Asc1>:
sub    $0x28,%rsp
movsd  %xmm3,0x18(%rsp)
movsd  %xmm2,0x10(%rsp)
movaps %xmm1,(%rsp)
call   1030 <swe_degnorm@plt>
movsd  %xmm0,0x20(%rsp)
movsd  0xea9(%rip),%xmm0
subsd  (%rsp),%xmm0
call   1040 <fabs@plt>
test   %eax,%eax
jle    11ca <Asc1+0x9a>
movsd  0xe93(%rip),%xmm0
addsd  (%rsp),%xmm0
call   1040 <fabs@plt>
test   %eax,%eax
jle    11d7 <Asc1+0xa7>
movsd  0x20(%rsp),%xmm2
movapd %xmm2,%xmm0
divsd  0xe73(%rip),%xmm0
addsd  0xe73(%rip),%xmm0
cvttsd2si %xmm0,%eax
cmp    $0x3,%eax
je     11e0 <Asc1+0xb0>
cmp    $0x2,%eax
movaps (%rsp),%xmm0
je     120f <Asc1+0xdf>
cmp    $0x1,%eax
jne    1240 <Asc1+0x110>
cvttsd2si %xmm2,%edi
movsd  0x10(%rsp),%xmm1
movsd  0x18(%rsp),%xmm2
call   1050 <Asc2@plt>
jmp    126a <Asc1+0x13a>
movsd  0xe3e(%rip),%xmm0
add    $0x28,%rsp
ret
xorpd  %xmm0,%xmm0
add    $0x28,%rsp
ret
addsd  0xe30(%rip),%xmm2
cvttsd2si %xmm2,%edi
movaps (%rsp),%xmm0
xorps  0xe59(%rip),%xmm0
movsd  0x10(%rsp),%xmm1
movsd  0x18(%rsp),%xmm2
call   1050 <Asc2@plt>
add    $0xb4,%eax
jmp    126a <Asc1+0x13a>
movsd  0xdf9(%rip),%xmm1
subsd  %xmm2,%xmm1
cvttsd2si %xmm1,%edi
xorps  0xe2a(%rip),%xmm0
movsd  0x10(%rsp),%xmm1
movsd  0x18(%rsp),%xmm2
call   1050 <Asc2@plt>
mov    %eax,%ecx
mov    $0xb4,%eax
jmp    1268 <Asc1+0x138>
movsd  0xdd8(%rip),%xmm1
subsd  %xmm2,%xmm1
cvttsd2si %xmm1,%edi
movsd  0x10(%rsp),%xmm1
movsd  0x18(%rsp),%xmm2
call   1050 <Asc2@plt>
mov    %eax,%ecx
mov    $0x168,%eax
sub    %ecx,%eax
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
call   1030 <swe_degnorm@plt>
movapd %xmm0,%xmm1
movsd  0xda6(%rip),%xmm0
movsd  %xmm1,(%rsp)
addsd  %xmm1,%xmm0
call   1040 <fabs@plt>
test   %eax,%eax
movsd  0xd66(%rip),%xmm1
jle    12a1 <Asc1+0x171>
movsd  (%rsp),%xmm1
movsd  0xd6f(%rip),%xmm0
movsd  %xmm1,(%rsp)
addsd  %xmm1,%xmm0
call   1040 <fabs@plt>
test   %eax,%eax
jle    12c2 <Asc1+0x192>
movsd  (%rsp),%xmm1
jmp    12ca <Asc1+0x19a>
movsd  0xd46(%rip),%xmm1
movsd  0xd5e(%rip),%xmm0
movsd  %xmm1,(%rsp)
addsd  %xmm1,%xmm0
call   1040 <fabs@plt>
test   %eax,%eax
jle    12eb <Asc1+0x1bb>
movsd  (%rsp),%xmm1
jmp    12f3 <Asc1+0x1c3>
movsd  0xd45(%rip),%xmm1
movsd  %xmm1,(%rsp)
movsd  0xd40(%rip),%xmm0
addsd  %xmm1,%xmm0
call   1040 <fabs@plt>
xorpd  %xmm0,%xmm0
test   %eax,%eax
jle    1316 <Asc1+0x1e6>
movsd  (%rsp),%xmm0
add    $0x28,%rsp
ret

LLVM IR (-O0):
define double @Asc1(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 i32
%11 = alloca double
store double %0, double* %6
store double %1, double* %7
store double %2, double* %8
store double %3, double* %9
%12 = load double, double* %6
%13 = call double @swe_degnorm(double %12)
store double %13, double* %6
%14 = load double, double* %6
%15 = fdiv double %14, 9.000000e+01
%16 = fadd double %15, 1.000000e+00
%17 = fptosi double %16 to i32
store i32 %17, i32* %10
%18 = load double, double* %7
%19 = fsub double 9.000000e+01, %18
%20 = call i32 @fabs(double %19)
%21 = sitofp i32 %20 to double
%22 = fcmp olt double %21, 1.000000e-10
br i1 %22, label %23, label %24
23: ; preds = %4
store double 1.800000e+02, double* %5
br label %114
24: ; preds = %4
%25 = load double, double* %7
%26 = fadd double 9.000000e+01, %25
%27 = call i32 @fabs(double %26)
%28 = sitofp i32 %27 to double
%29 = fcmp olt double %28, 1.000000e-10
br i1 %29, label %30, label %31
30: ; preds = %24
store double 0.000000e+00, double* %5
br label %114
31: ; preds = %24
%32 = load i32, i32* %10
%33 = icmp eq i32 %32, 1
br i1 %33, label %34, label %42
34: ; preds = %31
%35 = load double, double* %6
%36 = fptosi double %35 to i32
%37 = load double, double* %7
%38 = load double, double* %8
%39 = load double, double* %9
%40 = call i32 @Asc2(i32 %36, double %37, double %38, double %39)
%41 = sitofp i32 %40 to double
store double %41, double* %11
br label %82
42: ; preds = %31
%43 = load i32, i32* %10
%44 = icmp eq i32 %43, 2
br i1 %44, label %45, label %56
45: ; preds = %42
%46 = load double, double* %6
%47 = fsub double 1.800000e+02, %46
%48 = fptosi double %47 to i32
%49 = load double, double* %7
%50 = fneg double %49
%51 = load double, double* %8
%52 = load double, double* %9
%53 = call i32 @Asc2(i32 %48, double %50, double %51, double %52)
%54 = sub nsw i32 180, %53
%55 = sitofp i32 %54 to double
store double %55, double* %11
br label %81
56: ; preds = %42
%57 = load i32, i32* %10
%58 = icmp eq i32 %57, 3
br i1 %58, label %59, label %70
59: ; preds = %56
%60 = load double, double* %6
%61 = fsub double %60, 1.800000e+02
%62 = fptosi double %61 to i32
%63 = load double, double* %7
%64 = fneg double %63
%65 = load double, double* %8
%66 = load double, double* %9
%67 = call i32 @Asc2(i32 %62, double %64, double %65, double %66)
%68 = add nsw i32 180, %67
%69 = sitofp i32 %68 to double
store double %69, double* %11
br label %80
70: ; preds = %56
%71 = load double, double* %6
%72 = fsub double 3.600000e+02, %71
%73 = fptosi double %72 to i32
%74 = load double, double* %7
%75 = load double, double* %8
%76 = load double, double* %9
%77 = call i32 @Asc2(i32 %73, double %74, double %75, double %76)
%78 = sub nsw i32 360, %77
%79 = sitofp i32 %78 to double
store double %79, double* %11
br label %80
80: ; preds = %70, %59
br label %81
81: ; preds = %80, %45
br label %82
82: ; preds = %81, %34
%83 = load double, double* %11
%84 = call double @swe_degnorm(double %83)
store double %84, double* %11
%85 = load double, double* %11
%86 = fsub double %85, 9.000000e+01
%87 = call i32 @fabs(double %86)
%88 = sitofp i32 %87 to double
%89 = fcmp olt double %88, 1.000000e-10
br i1 %89, label %90, label %91
90: ; preds = %82
store double 9.000000e+01, double* %11
br label %91
91: ; preds = %90, %82
%92 = load double, double* %11
%93 = fsub double %92, 1.800000e+02
%94 = call i32 @fabs(double %93)
%95 = sitofp i32 %94 to double
%96 = fcmp olt double %95, 1.000000e-10
br i1 %96, label %97, label %98
97: ; preds = %91
store double 1.800000e+02, double* %11
br label %98
98: ; preds = %97, %91
%99 = load double, double* %11
%100 = fsub double %99, 2.700000e+02
%101 = call i32 @fabs(double %100)
%102 = sitofp i32 %101 to double
%103 = fcmp olt double %102, 1.000000e-10
br i1 %103, label %104, label %105
104: ; preds = %98
store double 2.700000e+02, double* %11
br label %105
105: ; preds = %104, %98
%106 = load double, double* %11
%107 = fsub double %106, 3.600000e+02
%108 = call i32 @fabs(double %107)
%109 = sitofp i32 %108 to double
%110 = fcmp olt double %109, 1.000000e-10
br i1 %110, label %111, label %112
111: ; preds = %105
store double 0.000000e+00, double* %11
br label %112
112: ; preds = %111, %105
%113 = load double, double* %11
store double %113, double* %5
br label %114
114: ; preds = %112, %30, %23
%115 = load double, double* %5
ret double %115
}

LLVM IR (-O2):
define double @Asc1(double %0, double %1, double %2, double %3) {
%5 = tail call double @swe_degnorm(double %0)
%6 = fdiv double %5, 9.000000e+01
%7 = fadd double %6, 1.000000e+00
%8 = fptosi double %7 to i32
%9 = fsub double 9.000000e+01, %1
%10 = tail call i32 @fabs(double %9)
%11 = icmp slt i32 %10, 1
br i1 %11, label %57, label %12
12: ; preds = %4
%13 = fadd double %1, 9.000000e+01
%14 = tail call i32 @fabs(double %13)
%15 = icmp slt i32 %14, 1
br i1 %15, label %57, label %16
16: ; preds = %12
switch i32 %8, label %32 [
i32 1, label %17
i32 2, label %20
i32 3, label %26
]
17: ; preds = %16
%18 = fptosi double %5 to i32
%19 = tail call i32 @Asc2(i32 %18, double %1, double %2, double %3)
br label %37
20: ; preds = %16
%21 = fsub double 1.800000e+02, %5
%22 = fptosi double %21 to i32
%23 = fneg double %1
%24 = tail call i32 @Asc2(i32 %22, double %23, double %2, double %3)
%25 = sub nsw i32 180, %24
br label %37
26: ; preds = %16
%27 = fadd double %5, -1.800000e+02
%28 = fptosi double %27 to i32
%29 = fneg double %1
%30 = tail call i32 @Asc2(i32 %28, double %29, double %2, double %3)
%31 = add nsw i32 %30, 180
br label %37
32: ; preds = %16
%33 = fsub double 3.600000e+02, %5
%34 = fptosi double %33 to i32
%35 = tail call i32 @Asc2(i32 %34, double %1, double %2, double %3)
%36 = sub nsw i32 360, %35
br label %37
37: ; preds = %20, %32, %26, %17
%38 = phi i32 [ %19, %17 ], [ %25, %20 ], [ %31, %26 ], [ %36, %32 ]
%39 = sitofp i32 %38 to double
%40 = tail call double @swe_degnorm(double %39)
%41 = fadd double %40, -9.000000e+01
%42 = tail call i32 @fabs(double %41)
%43 = icmp slt i32 %42, 1
%44 = select i1 %43, double 9.000000e+01, double %40
%45 = fadd double %44, -1.800000e+02
%46 = tail call i32 @fabs(double %45)
%47 = icmp slt i32 %46, 1
%48 = select i1 %47, double 1.800000e+02, double %44
%49 = fadd double %48, -2.700000e+02
%50 = tail call i32 @fabs(double %49)
%51 = icmp slt i32 %50, 1
%52 = select i1 %51, double 2.700000e+02, double %48
%53 = fadd double %52, -3.600000e+02
%54 = tail call i32 @fabs(double %53)
%55 = icmp slt i32 %54, 1
%56 = select i1 %55, double 0.000000e+00, double %52
br label %57
57: ; preds = %12, %4, %37
%58 = phi double [ %56, %37 ], [ 1.800000e+02, %4 ], [ 0.000000e+00, %12 ]
ret double %58
}