#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 (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    $0x30,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  %xmm3,-0x20(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1030 <swe_degnorm@plt>
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  0xea0(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  0xe8c(%rip),%xmm1
addsd  %xmm1,%xmm0
cvttsd2si %xmm0,%eax
mov    %eax,-0x24(%rbp)
cmpl   $0x1,-0x24(%rbp)
jne    11b0 <Asc1+0x80>
cvttsd2si -0x8(%rbp),%edi
movsd  -0x10(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm1
movsd  -0x20(%rbp),%xmm2
call   1050 <Asc2@plt>
cvtsi2sd %eax,%xmm0
movsd  %xmm0,-0x30(%rbp)
jmp    12ab <Asc1+0x17b>
cmpl   $0x2,-0x24(%rbp)
jne    120d <Asc1+0xdd>
movsd  0xe56(%rip),%xmm0
subsd  -0x8(%rbp),%xmm0
cvttsd2si %xmm0,%edi
movsd  -0x10(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  -0x18(%rbp),%xmm1
movsd  -0x20(%rbp),%xmm2
call   1050 <Asc2@plt>
mov    %eax,%ecx
mov    $0xb4,%eax
sub    %ecx,%eax
cvtsi2sd %eax,%xmm0
movsd  %xmm0,-0x30(%rbp)
jmp    12a6 <Asc1+0x176>
cmpl   $0x3,-0x24(%rbp)
jne    126a <Asc1+0x13a>
movsd  -0x8(%rbp),%xmm0
movsd  0xdf4(%rip),%xmm1
subsd  %xmm1,%xmm0
cvttsd2si %xmm0,%edi
movsd  -0x10(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  -0x18(%rbp),%xmm1
movsd  -0x20(%rbp),%xmm2
call   1050 <Asc2@plt>
add    $0xb4,%eax
cvtsi2sd %eax,%xmm0
movsd  %xmm0,-0x30(%rbp)
jmp    12a1 <Asc1+0x171>
movsd  0xd9e(%rip),%xmm0
subsd  -0x8(%rbp),%xmm0
cvttsd2si %xmm0,%edi
movsd  -0x10(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm1
movsd  -0x20(%rbp),%xmm2
call   1050 <Asc2@plt>
mov    %eax,%ecx
mov    $0x168,%eax
sub    %ecx,%eax
cvtsi2sd %eax,%xmm0
movsd  %xmm0,-0x30(%rbp)
jmp    12a6 <Asc1+0x176>
jmp    12ab <Asc1+0x17b>
movsd  -0x30(%rbp),%xmm0
call   1030 <swe_degnorm@plt>
movsd  %xmm0,-0x30(%rbp)
movsd  -0x30(%rbp),%xmm0
movsd  0xd41(%rip),%xmm1
subsd  %xmm1,%xmm0
call   1040 <fabs@plt>
cvtsi2sd %eax,%xmm1
movsd  0xd44(%rip),%xmm0
ucomisd %xmm1,%xmm0
jbe    12f3 <Asc1+0x1c3>
movsd  0xd1a(%rip),%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  -0x30(%rbp),%xmm0
movsd  0xd18(%rip),%xmm1
subsd  %xmm1,%xmm0
call   1040 <fabs@plt>
cvtsi2sd %eax,%xmm1
movsd  0xd0b(%rip),%xmm0
ucomisd %xmm1,%xmm0
jbe    132c <Asc1+0x1fc>
movsd  0xcf1(%rip),%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  -0x30(%rbp),%xmm0
movsd  0xcef(%rip),%xmm1
subsd  %xmm1,%xmm0
call   1040 <fabs@plt>
cvtsi2sd %eax,%xmm1
movsd  0xcd2(%rip),%xmm0
ucomisd %xmm1,%xmm0
jbe    1365 <Asc1+0x235>
movsd  0xcc8(%rip),%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  -0x30(%rbp),%xmm0
movsd  0xc9e(%rip),%xmm1
subsd  %xmm1,%xmm0
call   1040 <fabs@plt>
cvtsi2sd %eax,%xmm1
movsd  0xc99(%rip),%xmm0
ucomisd %xmm1,%xmm0
jbe    1399 <Asc1+0x269>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  -0x30(%rbp),%xmm0
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Asc1>:
sub    $0x28,%rsp
movsd  %xmm3,(%rsp)
movsd  %xmm2,0x8(%rsp)
movaps %xmm1,0x10(%rsp)
call   1030 <swe_degnorm@plt>
movapd %xmm0,%xmm1
divsd  0xeab(%rip),%xmm1
addsd  0xeab(%rip),%xmm1
cvttsd2si %xmm1,%eax
cmp    $0x3,%eax
je     1192 <Asc1+0x62>
cmp    $0x2,%eax
je     11c1 <Asc1+0x91>
cmp    $0x1,%eax
jne    11f6 <Asc1+0xc6>
cvttsd2si %xmm0,%edi
movaps 0x10(%rsp),%xmm0
movsd  0x8(%rsp),%xmm1
movsd  (%rsp),%xmm2
call   1050 <Asc2@plt>
jmp    1224 <Asc1+0xf4>
addsd  0xe76(%rip),%xmm0
cvttsd2si %xmm0,%edi
movaps 0x10(%rsp),%xmm0
xorps  0xea6(%rip),%xmm0
movsd  0x8(%rsp),%xmm1
movsd  (%rsp),%xmm2
call   1050 <Asc2@plt>
add    $0xb4,%eax
jmp    1224 <Asc1+0xf4>
movsd  0xe4f(%rip),%xmm1
subsd  %xmm0,%xmm1
cvttsd2si %xmm1,%edi
movaps 0x10(%rsp),%xmm0
xorps  0xe73(%rip),%xmm0
movsd  0x8(%rsp),%xmm1
movsd  (%rsp),%xmm2
call   1050 <Asc2@plt>
mov    %eax,%ecx
mov    $0xb4,%eax
jmp    1222 <Asc1+0xf2>
movsd  0xe22(%rip),%xmm1
subsd  %xmm0,%xmm1
cvttsd2si %xmm1,%edi
movaps 0x10(%rsp),%xmm0
movsd  0x8(%rsp),%xmm1
movsd  (%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  0xdec(%rip),%xmm0
movsd  %xmm1,(%rsp)
addsd  %xmm1,%xmm0
call   1040 <fabs@plt>
test   %eax,%eax
jle    1255 <Asc1+0x125>
movsd  (%rsp),%xmm1
jmp    125d <Asc1+0x12d>
movsd  0xda3(%rip),%xmm1
movsd  0xdab(%rip),%xmm0
movsd  %xmm1,(%rsp)
addsd  %xmm1,%xmm0
call   1040 <fabs@plt>
test   %eax,%eax
jle    127e <Asc1+0x14e>
movsd  (%rsp),%xmm1
jmp    1286 <Asc1+0x156>
movsd  0xd92(%rip),%xmm1
movsd  0xda2(%rip),%xmm0
movsd  %xmm1,(%rsp)
addsd  %xmm1,%xmm0
call   1040 <fabs@plt>
test   %eax,%eax
jle    12a7 <Asc1+0x177>
movsd  (%rsp),%xmm1
jmp    12af <Asc1+0x17f>
movsd  0xd89(%rip),%xmm1
movsd  %xmm1,(%rsp)
movsd  0xd84(%rip),%xmm0
addsd  %xmm1,%xmm0
call   1040 <fabs@plt>
xorpd  %xmm0,%xmm0
test   %eax,%eax
jle    12d2 <Asc1+0x1a2>
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 i32
%10 = alloca double
store double %0, double* %5
store double %1, double* %6
store double %2, double* %7
store double %3, double* %8
%11 = load double, double* %5
%12 = call double @swe_degnorm(double %11)
store double %12, double* %5
%13 = load double, double* %5
%14 = fdiv double %13, 9.000000e+01
%15 = fadd double %14, 1.000000e+00
%16 = fptosi double %15 to i32
store i32 %16, i32* %9
%17 = load i32, i32* %9
%18 = icmp eq i32 %17, 1
br i1 %18, label %19, label %27
19: ; preds = %4
%20 = load double, double* %5
%21 = fptosi double %20 to i32
%22 = load double, double* %6
%23 = load double, double* %7
%24 = load double, double* %8
%25 = call i32 @Asc2(i32 %21, double %22, double %23, double %24)
%26 = sitofp i32 %25 to double
store double %26, double* %10
br label %67
27: ; preds = %4
%28 = load i32, i32* %9
%29 = icmp eq i32 %28, 2
br i1 %29, label %30, label %41
30: ; preds = %27
%31 = load double, double* %5
%32 = fsub double 1.800000e+02, %31
%33 = fptosi double %32 to i32
%34 = load double, double* %6
%35 = fneg double %34
%36 = load double, double* %7
%37 = load double, double* %8
%38 = call i32 @Asc2(i32 %33, double %35, double %36, double %37)
%39 = sub nsw i32 180, %38
%40 = sitofp i32 %39 to double
store double %40, double* %10
br label %66
41: ; preds = %27
%42 = load i32, i32* %9
%43 = icmp eq i32 %42, 3
br i1 %43, label %44, label %55
44: ; preds = %41
%45 = load double, double* %5
%46 = fsub double %45, 1.800000e+02
%47 = fptosi double %46 to i32
%48 = load double, double* %6
%49 = fneg double %48
%50 = load double, double* %7
%51 = load double, double* %8
%52 = call i32 @Asc2(i32 %47, double %49, double %50, double %51)
%53 = add nsw i32 180, %52
%54 = sitofp i32 %53 to double
store double %54, double* %10
br label %65
55: ; preds = %41
%56 = load double, double* %5
%57 = fsub double 3.600000e+02, %56
%58 = fptosi double %57 to i32
%59 = load double, double* %6
%60 = load double, double* %7
%61 = load double, double* %8
%62 = call i32 @Asc2(i32 %58, double %59, double %60, double %61)
%63 = sub nsw i32 360, %62
%64 = sitofp i32 %63 to double
store double %64, double* %10
br label %65
65: ; preds = %55, %44
br label %66
66: ; preds = %65, %30
br label %67
67: ; preds = %66, %19
%68 = load double, double* %10
%69 = call double @swe_degnorm(double %68)
store double %69, double* %10
%70 = load double, double* %10
%71 = fsub double %70, 9.000000e+01
%72 = call i32 @fabs(double %71)
%73 = sitofp i32 %72 to double
%74 = fcmp olt double %73, 1.000000e-10
br i1 %74, label %75, label %76
75: ; preds = %67
store double 9.000000e+01, double* %10
br label %76
76: ; preds = %75, %67
%77 = load double, double* %10
%78 = fsub double %77, 1.800000e+02
%79 = call i32 @fabs(double %78)
%80 = sitofp i32 %79 to double
%81 = fcmp olt double %80, 1.000000e-10
br i1 %81, label %82, label %83
82: ; preds = %76
store double 1.800000e+02, double* %10
br label %83
83: ; preds = %82, %76
%84 = load double, double* %10
%85 = fsub double %84, 2.700000e+02
%86 = call i32 @fabs(double %85)
%87 = sitofp i32 %86 to double
%88 = fcmp olt double %87, 1.000000e-10
br i1 %88, label %89, label %90
89: ; preds = %83
store double 2.700000e+02, double* %10
br label %90
90: ; preds = %89, %83
%91 = load double, double* %10
%92 = fsub double %91, 3.600000e+02
%93 = call i32 @fabs(double %92)
%94 = sitofp i32 %93 to double
%95 = fcmp olt double %94, 1.000000e-10
br i1 %95, label %96, label %97
96: ; preds = %90
store double 0.000000e+00, double* %10
br label %97
97: ; preds = %96, %90
%98 = load double, double* %10
ret double %98
}

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
switch i32 %8, label %24 [
i32 1, label %9
i32 2, label %12
i32 3, label %18
]
9: ; preds = %4
%10 = fptosi double %5 to i32
%11 = tail call i32 @Asc2(i32 %10, double %1, double %2, double %3)
br label %29
12: ; preds = %4
%13 = fsub double 1.800000e+02, %5
%14 = fptosi double %13 to i32
%15 = fneg double %1
%16 = tail call i32 @Asc2(i32 %14, double %15, double %2, double %3)
%17 = sub nsw i32 180, %16
br label %29
18: ; preds = %4
%19 = fadd double %5, -1.800000e+02
%20 = fptosi double %19 to i32
%21 = fneg double %1
%22 = tail call i32 @Asc2(i32 %20, double %21, double %2, double %3)
%23 = add nsw i32 %22, 180
br label %29
24: ; preds = %4
%25 = fsub double 3.600000e+02, %5
%26 = fptosi double %25 to i32
%27 = tail call i32 @Asc2(i32 %26, double %1, double %2, double %3)
%28 = sub nsw i32 360, %27
br label %29
29: ; preds = %12, %24, %18, %9
%30 = phi i32 [ %11, %9 ], [ %17, %12 ], [ %23, %18 ], [ %28, %24 ]
%31 = sitofp i32 %30 to double
%32 = tail call double @swe_degnorm(double %31)
%33 = fadd double %32, -9.000000e+01
%34 = tail call i32 @fabs(double %33)
%35 = icmp slt i32 %34, 1
%36 = select i1 %35, double 9.000000e+01, double %32
%37 = fadd double %36, -1.800000e+02
%38 = tail call i32 @fabs(double %37)
%39 = icmp slt i32 %38, 1
%40 = select i1 %39, double 1.800000e+02, double %36
%41 = fadd double %40, -2.700000e+02
%42 = tail call i32 @fabs(double %41)
%43 = icmp slt i32 %42, 1
%44 = select i1 %43, double 2.700000e+02, double %40
%45 = fadd double %44, -3.600000e+02
%46 = tail call i32 @fabs(double %45)
%47 = icmp slt i32 %46, 1
%48 = select i1 %47, double 0.000000e+00, double %44
ret double %48
}