#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 */
float atan(float);
scalar_t__ fabs(float);
float sidesToAngle(float sideOne, float sideTwo) {
  if (sideOne == 0.0 && sideTwo == 0.0) {
    return -1.0;
  }
  if (sideOne == 0.0 || sideTwo == 0.0) {
    if (sideOne == 0.0) {
      if (sideTwo > 0.0) {
        return 90.0;
      } else {
        return 270.0;
      }
    } else {
      if (sideOne > 0.0) {
        return 0.0;
      } else {
        return 180.0;
      }
    }
  }
  float angle = atan(sideTwo / sideOne);
  angle = ((angle * 180.0) / 3.14);
  float quadrant = 0.0;
  if (angle > 0.0) {
    if (sideOne < 0.0 && sideTwo < 0.0) {
      quadrant = 3.0;
    } else {
      quadrant = 1.0;
    }
  } else {
    if (sideOne < 0.0) {
      quadrant = 2.0;
    } else {
      quadrant = 4.0;
    }
  }
  float nearbyCD = (90.0 * (quadrant - 1.0));
  float finalAngle = nearbyCD;
  if (fabs(sideOne) >= fabs(sideTwo)) {
    finalAngle += fabs(angle);
  } else {
    if (quadrant == 1.0 || quadrant == 4.0) {
      if (quadrant == 4.0) {
        finalAngle += 90.0;
      }
      finalAngle += angle;
    } else {
      return (angle + 180.0);
    }
  }
  return finalAngle;
}


x86 assembly (clang, -O0):
<sidesToAngle>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movss  %xmm0,-0x8(%rbp)
movss  %xmm1,-0xc(%rbp)
movss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    117c <sidesToAngle+0x5c>
jp     117c <sidesToAngle+0x5c>
movss  -0xc(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    117c <sidesToAngle+0x5c>
jp     117c <sidesToAngle+0x5c>
movss  0xed2(%rip),%xmm0
movss  %xmm0,-0x4(%rbp)
jmp    1470 <sidesToAngle+0x350>
movss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    119d <sidesToAngle+0x7d>
jp     119d <sidesToAngle+0x7d>
jmp    11b9 <sidesToAngle+0x99>
movss  -0xc(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    1244 <sidesToAngle+0x124>
jp     1244 <sidesToAngle+0x124>
movss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    120f <sidesToAngle+0xef>
jp     120f <sidesToAngle+0xef>
movss  -0xc(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jbe    11fd <sidesToAngle+0xdd>
movss  0xe4d(%rip),%xmm0
movss  %xmm0,-0x4(%rbp)
jmp    1470 <sidesToAngle+0x350>
movss  0xe37(%rip),%xmm0
movss  %xmm0,-0x4(%rbp)
jmp    1470 <sidesToAngle+0x350>
movss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jbe    1232 <sidesToAngle+0x112>
xorps  %xmm0,%xmm0
movss  %xmm0,-0x4(%rbp)
jmp    1470 <sidesToAngle+0x350>
movss  0xdfe(%rip),%xmm0
movss  %xmm0,-0x4(%rbp)
jmp    1470 <sidesToAngle+0x350>
movss  -0xc(%rbp),%xmm0
divss  -0x8(%rbp),%xmm0
call   1040 <atan@plt>
movss  %xmm0,-0x10(%rbp)
movss  -0x10(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xd9f(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xd8b(%rip),%xmm1
divsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x10(%rbp)
xorps  %xmm0,%xmm0
movss  %xmm0,-0x14(%rbp)
movss  -0x10(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jbe    12f0 <sidesToAngle+0x1d0>
movss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
xorps  %xmm0,%xmm0
ucomisd %xmm1,%xmm0
jbe    12de <sidesToAngle+0x1be>
movss  -0xc(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
xorps  %xmm0,%xmm0
ucomisd %xmm1,%xmm0
jbe    12de <sidesToAngle+0x1be>
movss  0xd60(%rip),%xmm0
movss  %xmm0,-0x14(%rbp)
jmp    12eb <sidesToAngle+0x1cb>
movss  0xd4a(%rip),%xmm0
movss  %xmm0,-0x14(%rbp)
jmp    132a <sidesToAngle+0x20a>
movss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
xorps  %xmm0,%xmm0
ucomisd %xmm1,%xmm0
jbe    1318 <sidesToAngle+0x1f8>
movss  0xd1e(%rip),%xmm0
movss  %xmm0,-0x14(%rbp)
jmp    1325 <sidesToAngle+0x205>
movss  0xd08(%rip),%xmm0
movss  %xmm0,-0x14(%rbp)
jmp    132a <sidesToAngle+0x20a>
movss  -0x14(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
movsd  0xcdd(%rip),%xmm0
subsd  %xmm0,%xmm1
movsd  0xcc9(%rip),%xmm0
mulsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x18(%rbp)
movss  -0x18(%rbp),%xmm0
movss  %xmm0,-0x1c(%rbp)
movss  -0x8(%rbp),%xmm0
call   1030 <fabs@plt>
mov    %rax,-0x28(%rbp)
movss  -0xc(%rbp),%xmm0
call   1030 <fabs@plt>
mov    %rax,%rcx
mov    -0x28(%rbp),%rax
cmp    %rcx,%rax
jl     13a4 <sidesToAngle+0x284>
movss  -0x10(%rbp),%xmm0
call   1030 <fabs@plt>
cvtsi2ss %rax,%xmm0
addss  -0x1c(%rbp),%xmm0
movss  %xmm0,-0x1c(%rbp)
jmp    1466 <sidesToAngle+0x346>
movss  -0x14(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xc63(%rip),%xmm1
ucomisd %xmm1,%xmm0
jne    13ca <sidesToAngle+0x2aa>
jp     13ca <sidesToAngle+0x2aa>
jmp    13eb <sidesToAngle+0x2cb>
movss  -0x14(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xc45(%rip),%xmm1
ucomisd %xmm1,%xmm0
jne    143e <sidesToAngle+0x31e>
jp     143e <sidesToAngle+0x31e>
movss  -0x14(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xc24(%rip),%xmm1
ucomisd %xmm1,%xmm0
jne    142a <sidesToAngle+0x30a>
jp     142a <sidesToAngle+0x30a>
movss  -0x1c(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xbf3(%rip),%xmm1
addsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x1c(%rbp)
movss  -0x10(%rbp),%xmm0
addss  -0x1c(%rbp),%xmm0
movss  %xmm0,-0x1c(%rbp)
jmp    1461 <sidesToAngle+0x341>
movss  -0x10(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xbb9(%rip),%xmm1
addsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x4(%rbp)
jmp    1470 <sidesToAngle+0x350>
jmp    1466 <sidesToAngle+0x346>
movss  -0x1c(%rbp),%xmm0
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sidesToAngle>:
push   %rbp
push   %rbx
sub    $0x38,%rsp
movaps %xmm0,%xmm2
xorps  %xmm0,%xmm0
ucomiss %xmm0,%xmm2
jne    1147 <sidesToAngle+0x27>
jp     1147 <sidesToAngle+0x27>
ucomiss %xmm0,%xmm1
jne    1147 <sidesToAngle+0x27>
jp     1147 <sidesToAngle+0x27>
movss  0xebe(%rip),%xmm0
jmp    12cb <sidesToAngle+0x1ab>
ucomiss %xmm0,%xmm2
jne    114e <sidesToAngle+0x2e>
jnp    11ae <sidesToAngle+0x8e>
xorps  %xmm0,%xmm0
ucomiss %xmm0,%xmm1
jne    1158 <sidesToAngle+0x38>
jnp    11ae <sidesToAngle+0x8e>
xor    %ebx,%ebx
ucomiss %xmm1,%xmm0
seta   %bpl
movss  %xmm1,0x14(%rsp)
movaps %xmm1,%xmm0
divss  %xmm2,%xmm0
movss  %xmm2,0x10(%rsp)
call   1040 <atan@plt>
xorps  %xmm3,%xmm3
movss  0x10(%rsp),%xmm1
cvtss2sd %xmm0,%xmm0
mulsd  0xe82(%rip),%xmm0
divsd  0xe82(%rip),%xmm0
cvtsd2ss %xmm0,%xmm0
xor    %eax,%eax
ucomiss %xmm1,%xmm3
seta   %cl
ja     11d9 <sidesToAngle+0xb9>
movsd  0xe74(%rip),%xmm2
jmp    11e8 <sidesToAngle+0xc8>
xorps  %xmm0,%xmm0
ucomiss %xmm0,%xmm2
jne    1293 <sidesToAngle+0x173>
jp     1293 <sidesToAngle+0x173>
xor    %eax,%eax
ucomiss %xmm0,%xmm1
seta   %al
lea    0xe71(%rip),%rcx
movss  (%rcx,%rax,4),%xmm0
jmp    12cb <sidesToAngle+0x1ab>
mov    %bpl,%bl
lea    0xe65(%rip),%rdx
movsd  (%rdx,%rbx,8),%xmm2
movss  %xmm0,0xc(%rsp)
ucomiss %xmm3,%xmm0
ja     1201 <sidesToAngle+0xe1>
mov    %cl,%al
lea    0xe5c(%rip),%rcx
movsd  (%rcx,%rax,8),%xmm2
movsd  %xmm2,0x18(%rsp)
movsd  0xe19(%rip),%xmm0
addsd  %xmm2,%xmm0
mulsd  0xe15(%rip),%xmm0
cvtsd2ss %xmm0,%xmm0
movaps %xmm0,0x20(%rsp)
movaps %xmm1,%xmm0
call   1030 <fabs@plt>
mov    %rax,%rbx
movss  0x14(%rsp),%xmm0
call   1030 <fabs@plt>
cmp    %rax,%rbx
jge    1272 <sidesToAngle+0x152>
movaps 0x20(%rsp),%xmm0
movsd  0x18(%rsp),%xmm1
ucomisd 0xdce(%rip),%xmm1
jne    1256 <sidesToAngle+0x136>
jnp    12a5 <sidesToAngle+0x185>
ucomisd 0xdda(%rip),%xmm1
jne    1262 <sidesToAngle+0x142>
jnp    12a5 <sidesToAngle+0x185>
movss  0xc(%rsp),%xmm0
addss  0xd94(%rip),%xmm0
jmp    12cb <sidesToAngle+0x1ab>
movss  0xc(%rsp),%xmm0
call   1030 <fabs@plt>
xorps  %xmm0,%xmm0
cvtsi2ss %rax,%xmm0
movaps 0x20(%rsp),%xmm1
addss  %xmm0,%xmm1
movaps %xmm1,%xmm0
jmp    12cb <sidesToAngle+0x1ab>
cmpltss %xmm2,%xmm0
movss  0xd64(%rip),%xmm1
andnps %xmm1,%xmm0
jmp    12cb <sidesToAngle+0x1ab>
ucomisd 0xd8b(%rip),%xmm1
jne    12c1 <sidesToAngle+0x1a1>
movss  0xc(%rsp),%xmm1
jp     12c7 <sidesToAngle+0x1a7>
addss  0xd49(%rip),%xmm0
jmp    12c7 <sidesToAngle+0x1a7>
movss  0xc(%rsp),%xmm1
addss  %xmm1,%xmm0
add    $0x38,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define float @sidesToAngle(float %0, float %1) {
%3 = fcmp oeq float %0, 0.000000e+00
%4 = fcmp oeq float %1, 0.000000e+00
%5 = and i1 %3, %4
br i1 %5, label %49, label %6
6: ; preds = %2
%7 = or i1 %3, %4
br i1 %7, label %8, label %15
8: ; preds = %6
br i1 %3, label %9, label %12
9: ; preds = %8
%10 = fcmp ogt float %1, 0.000000e+00
%11 = select i1 %10, float 9.000000e+01, float 2.700000e+02
br label %49
12: ; preds = %8
%13 = fcmp ogt float %0, 0.000000e+00
%14 = select i1 %13, float 0.000000e+00, float 1.800000e+02
br label %49
15: ; preds = %6
%16 = fdiv float %1, %0
%17 = tail call float @atan(float %16)
%18 = fpext float %17 to double
%19 = fmul double %18, 1.800000e+02
%20 = fdiv double %19, 3.140000e+00
%21 = fptrunc double %20 to float
%22 = fcmp ogt float %21, 0.000000e+00
%23 = fcmp olt float %0, 0.000000e+00
%24 = select i1 %23, double 2.000000e+00, double 4.000000e+00
%25 = fcmp olt float %1, 0.000000e+00
%26 = and i1 %23, %25
%27 = select i1 %26, double 3.000000e+00, double 1.000000e+00
%28 = select i1 %22, double %27, double %24
%29 = fadd double %28, -1.000000e+00
%30 = fmul double %29, 9.000000e+01
%31 = fptrunc double %30 to float
%32 = tail call i64 @fabs(float %0)
%33 = tail call i64 @fabs(float %1)
%34 = icmp slt i64 %32, %33
br i1 %34, label %39, label %35
35: ; preds = %15
%36 = tail call i64 @fabs(float %21)
%37 = sitofp i64 %36 to float
%38 = fadd float %31, %37
br label %49
39: ; preds = %15
%40 = fcmp oeq double %28, 1.000000e+00
%41 = fcmp oeq double %28, 4.000000e+00
%42 = or i1 %40, %41
br i1 %42, label %43, label %47
43: ; preds = %39
%44 = fadd float %31, 9.000000e+01
%45 = select i1 %41, float %44, float %31
%46 = fadd float %45, %21
br label %49
47: ; preds = %39
%48 = fadd float %21, 1.800000e+02
br label %49
49: ; preds = %47, %43, %35, %12, %9, %2
%50 = phi float [ -1.000000e+00, %2 ], [ %11, %9 ], [ %14, %12 ], [ %48, %47 ], [ %38, %35 ], [ %46, %43 ]
ret float %50
}