void polcar(x, y, r, th) double x, y;
double *r, *th;
{
  *r = (double)pow(((x) * (x)) + ((y) * (y)), 0.5);
  if (*r == 0.0 || *r == -0.0)
    *th = 0.0;
  else if (*r == -y)
    *th = (double)(-asin((double)1.0)) * 180.0 / 3.14159;
  else if (y < 0 && *r <= -y)
    *th = (double)(-asin((double)1.0)) * 180.0 / 3.14159;
  else if (*r <= y)
    *th = (double)(asin((double)1.0)) * 180.0 / 3.14159;
  else {
    *th = (double)(asin((double)y / (double)*r)) * 180.0 / 3.14159;
    if (x == 0)
      *th = 90.0;
  }
  if (x < 0)
    *th = 180.0 - (*th);
  if (x > 0)
    *th = 360.0 + (*th);
  if (x == 0 && y < 0)
    *th = 270.0;
  if (x > 0 && y > 0)
    *th -= 360.0;
  *th = (*th) * 3.14159 / 180.0;
}


x86 assembly (clang, -O0):
<polcar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
mov    %rdi,-0x18(%rbp)
mov    %rsi,-0x20(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x8(%rbp),%xmm2
movsd  -0x10(%rbp),%xmm1
mulsd  -0x10(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  0xea2(%rip),%xmm1
call   1040 <pow@plt>
mov    -0x18(%rbp),%rax
movsd  %xmm0,(%rax)
mov    -0x18(%rbp),%rax
movsd  (%rax),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    118b <polcar+0x6b>
jp     118b <polcar+0x6b>
jmp    11ab <polcar+0x8b>
mov    -0x18(%rbp),%rax
movsd  (%rax),%xmm0
movsd  0xe6d(%rip),%xmm1
ucomisd %xmm1,%xmm0
jne    11bb <polcar+0x9b>
jp     11bb <polcar+0x9b>
mov    -0x20(%rbp),%rax
xorps  %xmm0,%xmm0
movsd  %xmm0,(%rax)
jmp    1374 <polcar+0x254>
mov    -0x18(%rbp),%rax
movsd  (%rax),%xmm0
movsd  -0x10(%rbp),%xmm1
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
ucomisd %xmm1,%xmm0
jne    1238 <polcar+0x118>
jp     1238 <polcar+0x118>
movsd  0xe31(%rip),%xmm0
call   1030 <asin@plt>
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  0xdfd(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xde9(%rip),%xmm1
divsd  %xmm1,%xmm0
mov    -0x20(%rbp),%rax
movsd  %xmm0,(%rax)
jmp    136f <polcar+0x24f>
xorps  %xmm0,%xmm0
ucomisd -0x10(%rbp),%xmm0
jbe    12bd <polcar+0x19d>
mov    -0x18(%rbp),%rax
movsd  (%rax),%xmm1
movsd  -0x10(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
ucomisd %xmm1,%xmm0
jb     12bd <polcar+0x19d>
movsd  0xdac(%rip),%xmm0
call   1030 <asin@plt>
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  0xd78(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xd64(%rip),%xmm1
divsd  %xmm1,%xmm0
mov    -0x20(%rbp),%rax
movsd  %xmm0,(%rax)
jmp    136a <polcar+0x24a>
mov    -0x18(%rbp),%rax
movsd  (%rax),%xmm1
movsd  -0x10(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jb     1306 <polcar+0x1e6>
movsd  0xd4c(%rip),%xmm0
call   1030 <asin@plt>
movsd  0xd2f(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xd1b(%rip),%xmm1
divsd  %xmm1,%xmm0
mov    -0x20(%rbp),%rax
movsd  %xmm0,(%rax)
jmp    1365 <polcar+0x245>
movsd  -0x10(%rbp),%xmm0
mov    -0x18(%rbp),%rax
divsd  (%rax),%xmm0
call   1030 <asin@plt>
movsd  0xcf8(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xce4(%rip),%xmm1
divsd  %xmm1,%xmm0
mov    -0x20(%rbp),%rax
movsd  %xmm0,(%rax)
movsd  -0x8(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    1360 <polcar+0x240>
jp     1360 <polcar+0x240>
mov    -0x20(%rbp),%rax
movsd  0xcc4(%rip),%xmm0
movsd  %xmm0,(%rax)
jmp    1365 <polcar+0x245>
jmp    136a <polcar+0x24a>
jmp    136f <polcar+0x24f>
jmp    1374 <polcar+0x254>
xorps  %xmm0,%xmm0
ucomisd -0x8(%rbp),%xmm0
jbe    139a <polcar+0x27a>
mov    -0x20(%rbp),%rax
movsd  0xc8a(%rip),%xmm0
subsd  (%rax),%xmm0
mov    -0x20(%rbp),%rax
movsd  %xmm0,(%rax)
movsd  -0x8(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jbe    13c4 <polcar+0x2a4>
mov    -0x20(%rbp),%rax
movsd  0xc78(%rip),%xmm0
addsd  (%rax),%xmm0
mov    -0x20(%rbp),%rax
movsd  %xmm0,(%rax)
movsd  -0x8(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    13fa <polcar+0x2da>
jp     13fa <polcar+0x2da>
xorps  %xmm0,%xmm0
ucomisd -0x10(%rbp),%xmm0
jbe    13fa <polcar+0x2da>
mov    -0x20(%rbp),%rax
movsd  0xc42(%rip),%xmm0
movsd  %xmm0,(%rax)
movsd  -0x8(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jbe    1436 <polcar+0x316>
movsd  -0x10(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jbe    1436 <polcar+0x316>
mov    -0x20(%rbp),%rax
movsd  (%rax),%xmm0
movsd  0xc02(%rip),%xmm1
subsd  %xmm1,%xmm0
movsd  %xmm0,(%rax)
mov    -0x20(%rbp),%rax
movsd  0xbce(%rip),%xmm0
mulsd  (%rax),%xmm0
movsd  0xbca(%rip),%xmm1
divsd  %xmm1,%xmm0
mov    -0x20(%rbp),%rax
movsd  %xmm0,(%rax)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<polcar>:
push   %r14
push   %rbx
sub    $0x28,%rsp
mov    %rsi,%r14
mov    %rdi,%rbx
movapd %xmm1,(%rsp)
movapd %xmm1,%xmm2
mulsd  %xmm1,%xmm2
movapd %xmm0,0x10(%rsp)
mulsd  %xmm0,%xmm0
addsd  %xmm2,%xmm0
movsd  0xeb0(%rip),%xmm1
call   1040 <pow@plt>
movapd (%rsp),%xmm5
movapd %xmm0,%xmm1
movsd  %xmm0,(%rbx)
xorpd  %xmm6,%xmm6
ucomisd %xmm6,%xmm0
xorpd  %xmm0,%xmm0
jne    1172 <polcar+0x52>
jnp    11f0 <polcar+0xd0>
movapd 0xed6(%rip),%xmm2
xorpd  %xmm5,%xmm2
movsd  0xe82(%rip),%xmm0
ucomisd %xmm2,%xmm1
jne    118e <polcar+0x6e>
jnp    11f0 <polcar+0xd0>
xorpd  %xmm3,%xmm3
ucomisd %xmm5,%xmm3
jbe    119e <polcar+0x7e>
ucomisd %xmm1,%xmm2
jae    11f0 <polcar+0xd0>
ucomisd %xmm1,%xmm5
jae    11cd <polcar+0xad>
movapd %xmm5,%xmm0
divsd  %xmm1,%xmm0
call   1030 <asin@plt>
xorpd  %xmm1,%xmm1
movapd 0x10(%rsp),%xmm2
ucomisd %xmm1,%xmm2
jne    11d7 <polcar+0xb7>
jp     11d7 <polcar+0xb7>
movsd  0xe5d(%rip),%xmm0
jmp    11e7 <polcar+0xc7>
movsd  0xe3b(%rip),%xmm0
jmp    11f0 <polcar+0xd0>
mulsd  0xe39(%rip),%xmm0
divsd  0xe39(%rip),%xmm0
movapd (%rsp),%xmm5
xorpd  %xmm6,%xmm6
movsd  0xe20(%rip),%xmm1
movapd %xmm1,%xmm2
subsd  %xmm0,%xmm2
movapd 0x10(%rsp),%xmm7
movapd %xmm7,%xmm3
cmpltsd %xmm6,%xmm3
andpd  %xmm3,%xmm2
andnpd %xmm0,%xmm3
orpd   %xmm2,%xmm3
ucomisd %xmm6,%xmm7
movapd %xmm3,%xmm0
addsd  0xe05(%rip),%xmm0
xorpd  %xmm2,%xmm2
cmpltsd %xmm7,%xmm2
movapd %xmm2,%xmm4
andnpd %xmm3,%xmm4
andpd  %xmm0,%xmm2
orpd   %xmm4,%xmm2
cmpeqsd %xmm6,%xmm7
movapd %xmm7,%xmm3
andnpd %xmm2,%xmm3
movapd %xmm5,%xmm4
cmpltsd %xmm6,%xmm4
movsd  0xdd6(%rip),%xmm0
andpd  %xmm4,%xmm0
andnpd %xmm2,%xmm4
orpd   %xmm4,%xmm0
andpd  %xmm7,%xmm0
orpd   %xmm3,%xmm0
jbe    1299 <polcar+0x179>
cmpltsd %xmm5,%xmm6
movapd %xmm6,%xmm2
andnpd %xmm0,%xmm2
addsd  0xdb3(%rip),%xmm0
andpd  %xmm0,%xmm6
orpd   %xmm2,%xmm6
movapd %xmm6,%xmm0
mulsd  0xd7f(%rip),%xmm0
divsd  %xmm1,%xmm0
movsd  %xmm0,(%r14)
add    $0x28,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define void @polcar(double %0, double %1, double* nocapture %2, double* nocapture %3) {
%5 = fmul double %1, %1
%6 = tail call double @llvm.fmuladd.f64(double %0, double %0, double %5)
%7 = tail call double @pow(double %6, double 5.000000e-01)
store double %7, double* %2
%8 = fcmp oeq double %7, 0.000000e+00
br i1 %8, label %25, label %9
9: ; preds = %4
%10 = fneg double %1
%11 = fcmp oeq double %7, %10
br i1 %11, label %25, label %12
12: ; preds = %9
%13 = fcmp uge double %1, 0.000000e+00
%14 = fcmp ugt double %7, %10
%15 = select i1 %13, i1 true, i1 %14
br i1 %15, label %16, label %25
16: ; preds = %12
%17 = fcmp ugt double %7, %1
br i1 %17, label %18, label %25
18: ; preds = %16
%19 = fdiv double %1, %7
%20 = tail call double @asin(double %19)
%21 = fmul double %20, 1.800000e+02
%22 = fdiv double %21, 3.141590e+00
%23 = fcmp oeq double %0, 0.000000e+00
br i1 %23, label %24, label %25
24: ; preds = %18
br label %25
25: ; preds = %16, %12, %9, %4, %24, %18
%26 = phi double [ 9.000000e+01, %24 ], [ %22, %18 ], [ 0.000000e+00, %4 ], [ 0xC05680013ED9A6D4, %9 ], [ 0xC05680013ED9A6D4, %12 ], [ 0x405680013ED9A6D4, %16 ]
%27 = fcmp olt double %0, 0.000000e+00
%28 = fsub double 1.800000e+02, %26
%29 = select i1 %27, double %28, double %26
%30 = fcmp ogt double %0, 0.000000e+00
%31 = fadd double %29, 3.600000e+02
%32 = select i1 %30, double %31, double %29
%33 = fcmp oeq double %0, 0.000000e+00
%34 = fcmp olt double %1, 0.000000e+00
%35 = and i1 %33, %34
%36 = select i1 %35, double 2.700000e+02, double %32
%37 = fcmp ogt double %1, 0.000000e+00
%38 = and i1 %30, %37
%39 = fadd double %36, -3.600000e+02
%40 = select i1 %38, double %39, double %36
%41 = fmul double %40, 3.141590e+00
%42 = fdiv double %41, 1.800000e+02
store double %42, double* %3
ret void
}