#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 acos(int);
double asin(int);
double fabs(double);
double mod2pi(double);
double my_atan2(double, double);
double sin(double);
double sqrt(double);
double cc_c(double x, double y, double phi, double rs, double rc, double *t,
            double *u, double *v) {
  double a, b, u1, theta, alpha, length_rs, va;
  a = x - rs;
  b = y + rc;
  if ((fabs(a) < 1.0e-12) && (fabs(b) < 1.0e-12))
    return (10000);
  u1 = sqrt(a * a + b * b);
  if (u1 > (4 * (1.0)))
    return (10000);
  theta = my_atan2(b, a);
  *u = acos((8 * ((1.0) * (1.0)) - u1 * u1) / (8 * ((1.0) * (1.0))));
  va = sin(*u);
  if (fabs(va) < 0.001)
    va = 0.0;
  if ((fabs(va) < 0.001) && (fabs(u1) < 0.001))
    return (10000);
  alpha = asin((2 * (1.0)) * va / u1);
  *t = mod2pi(1.5707963268 - alpha + theta);
  *v = mod2pi(*t - *u - phi);
  length_rs = (1.0) * (*t + *u + *v);
  return (length_rs);
}


x86 assembly (clang, -O0):
<cc_c>:
push   %rbp
mov    %rsp,%rbp
sub    $0x80,%rsp
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x18(%rbp)
movsd  %xmm2,-0x20(%rbp)
movsd  %xmm3,-0x28(%rbp)
movsd  %xmm4,-0x30(%rbp)
mov    %rdi,-0x38(%rbp)
mov    %rsi,-0x40(%rbp)
mov    %rdx,-0x48(%rbp)
movsd  -0x10(%rbp),%xmm0
subsd  -0x28(%rbp),%xmm0
movsd  %xmm0,-0x50(%rbp)
movsd  -0x18(%rbp),%xmm0
addsd  -0x30(%rbp),%xmm0
movsd  %xmm0,-0x58(%rbp)
movsd  -0x50(%rbp),%xmm1
movaps 0xe86(%rip),%xmm0
pand   %xmm0,%xmm1
movsd  0xe3a(%rip),%xmm0
ucomisd %xmm1,%xmm0
jbe    1204 <cc_c+0xa4>
movsd  -0x58(%rbp),%xmm1
movaps 0xe64(%rip),%xmm0
pand   %xmm0,%xmm1
movsd  0xe18(%rip),%xmm0
ucomisd %xmm1,%xmm0
jbe    1204 <cc_c+0xa4>
movsd  0xe3e(%rip),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    13db <cc_c+0x27b>
movsd  -0x50(%rbp),%xmm0
movsd  -0x50(%rbp),%xmm2
movsd  -0x58(%rbp),%xmm1
mulsd  -0x58(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
call   1080 <sqrt@plt>
movsd  %xmm0,-0x60(%rbp)
movsd  -0x60(%rbp),%xmm0
movsd  0xdd1(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    1253 <cc_c+0xf3>
movsd  0xdef(%rip),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    13db <cc_c+0x27b>
movsd  -0x58(%rbp),%xmm0
movsd  -0x50(%rbp),%xmm1
call   1070 <my_atan2@plt>
movsd  %xmm0,-0x68(%rbp)
movsd  -0x60(%rbp),%xmm0
movsd  -0x60(%rbp),%xmm1
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  %xmm1,%xmm0
movsd  0xd84(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  0xd78(%rip),%xmm1
divsd  %xmm1,%xmm0
cvttsd2si %xmm0,%edi
call   1040 <acos@plt>
mov    -0x40(%rbp),%rax
movsd  %xmm0,(%rax)
mov    -0x40(%rbp),%rax
movsd  (%rax),%xmm0
call   1050 <sin@plt>
movsd  %xmm0,-0x80(%rbp)
movsd  -0x80(%rbp),%xmm1
movaps 0xd6d(%rip),%xmm0
pand   %xmm0,%xmm1
movsd  0xd31(%rip),%xmm0
ucomisd %xmm1,%xmm0
jbe    12f1 <cc_c+0x191>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x80(%rbp)
movsd  -0x80(%rbp),%xmm1
movaps 0xd43(%rip),%xmm0
pand   %xmm0,%xmm1
movsd  0xd07(%rip),%xmm0
ucomisd %xmm1,%xmm0
jbe    1347 <cc_c+0x1e7>
movsd  -0x60(%rbp),%xmm1
movaps 0xd21(%rip),%xmm0
pand   %xmm0,%xmm1
movsd  0xce5(%rip),%xmm0
ucomisd %xmm1,%xmm0
jbe    1347 <cc_c+0x1e7>
movsd  0xcfb(%rip),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    13db <cc_c+0x27b>
movsd  0xce1(%rip),%xmm0
mulsd  -0x80(%rbp),%xmm0
divsd  -0x60(%rbp),%xmm0
cvttsd2si %xmm0,%edi
call   1060 <asin@plt>
movsd  %xmm0,-0x70(%rbp)
movsd  0xcb9(%rip),%xmm0
subsd  -0x70(%rbp),%xmm0
addsd  -0x68(%rbp),%xmm0
call   1030 <mod2pi@plt>
mov    -0x38(%rbp),%rax
movsd  %xmm0,(%rax)
mov    -0x38(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x40(%rbp),%rax
subsd  (%rax),%xmm0
subsd  -0x20(%rbp),%xmm0
call   1030 <mod2pi@plt>
mov    -0x48(%rbp),%rax
movsd  %xmm0,(%rax)
mov    -0x38(%rbp),%rax
movsd  (%rax),%xmm1
mov    -0x40(%rbp),%rax
addsd  (%rax),%xmm1
mov    -0x48(%rbp),%rax
addsd  (%rax),%xmm1
movsd  0xc58(%rip),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x78(%rbp)
movsd  -0x78(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
add    $0x80,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cc_c>:
push   %r15
push   %r14
push   %rbx
sub    $0x30,%rsp
mov    %rdx,%r14
mov    %rsi,%rbx
mov    %rdi,%r15
movapd %xmm0,%xmm5
subsd  %xmm3,%xmm5
addsd  %xmm4,%xmm1
movapd 0xe7a(%rip),%xmm4
movapd %xmm5,%xmm3
andpd  %xmm4,%xmm3
movsd  0xe7a(%rip),%xmm0
ucomisd %xmm3,%xmm0
movsd  0xe76(%rip),%xmm3
jbe    11b6 <cc_c+0x56>
movapd %xmm1,%xmm6
andpd  %xmm4,%xmm6
ucomisd %xmm6,%xmm0
ja     1306 <cc_c+0x1a6>
movapd %xmm1,%xmm3
mulsd  %xmm1,%xmm3
movapd %xmm5,%xmm0
mulsd  %xmm5,%xmm0
addsd  %xmm3,%xmm0
xorpd  %xmm3,%xmm3
ucomisd %xmm3,%xmm0
movsd  %xmm2,0x28(%rsp)
jb     12d5 <cc_c+0x175>
sqrtsd %xmm0,%xmm0
ucomisd 0xe36(%rip),%xmm0
ja     12fe <cc_c+0x19e>
movapd %xmm0,(%rsp)
movapd %xmm1,%xmm0
movapd %xmm5,%xmm1
call   1070 <my_atan2@plt>
movsd  %xmm0,0x10(%rsp)
movapd (%rsp),%xmm0
mulsd  %xmm0,%xmm0
movsd  0xe0f(%rip),%xmm1
subsd  %xmm0,%xmm1
mulsd  0xe0b(%rip),%xmm1
cvttsd2si %xmm1,%edi
call   1040 <acos@plt>
movsd  %xmm0,(%rbx)
call   1050 <sin@plt>
movapd %xmm0,%xmm1
movapd 0xdbd(%rip),%xmm4
andpd  %xmm4,%xmm1
movsd  0xde9(%rip),%xmm2
cmpltsd %xmm2,%xmm1
andnpd %xmm0,%xmm1
movapd %xmm1,%xmm0
andpd  %xmm4,%xmm0
ucomisd %xmm0,%xmm2
movapd (%rsp),%xmm0
movsd  0xda7(%rip),%xmm3
jbe    1281 <cc_c+0x121>
andpd  %xmm0,%xmm4
ucomisd %xmm4,%xmm2
ja     1306 <cc_c+0x1a6>
addsd  %xmm1,%xmm1
divsd  %xmm0,%xmm1
cvttsd2si %xmm1,%edi
call   1060 <asin@plt>
movsd  0xda6(%rip),%xmm1
subsd  %xmm0,%xmm1
movsd  0x10(%rsp),%xmm0
addsd  %xmm1,%xmm0
call   1030 <mod2pi@plt>
movsd  %xmm0,(%r15)
subsd  (%rbx),%xmm0
subsd  0x28(%rsp),%xmm0
call   1030 <mod2pi@plt>
movsd  %xmm0,(%r14)
movsd  (%r15),%xmm3
addsd  (%rbx),%xmm3
addsd  %xmm0,%xmm3
jmp    1306 <cc_c+0x1a6>
movapd %xmm5,(%rsp)
movapd %xmm1,0x10(%rsp)
call   1080 <sqrt@plt>
movapd 0x10(%rsp),%xmm1
movapd (%rsp),%xmm5
ucomisd 0xd28(%rip),%xmm0
jbe    11f0 <cc_c+0x90>
movsd  0xd12(%rip),%xmm3
movapd %xmm3,%xmm0
add    $0x30,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define double @cc_c(double %0, double %1, double %2, double %3, double %4, double* nocapture %5, double* nocapture %6, double* nocapture writeonly %7) {
%9 = fsub double %0, %3
%10 = fadd double %1, %4
%11 = tail call double @llvm.fabs.f64(double %9)
%12 = fcmp olt double %11, 0x3D719799812DEA11
%13 = tail call double @llvm.fabs.f64(double %10)
%14 = fcmp olt double %13, 0x3D719799812DEA11
%15 = select i1 %12, i1 %14, i1 false
br i1 %15, label %53, label %16
16: ; preds = %8
%17 = fmul double %10, %10
%18 = tail call double @llvm.fmuladd.f64(double %9, double %9, double %17)
%19 = tail call double @sqrt(double %18)
%20 = fcmp ogt double %19, 4.000000e+00
br i1 %20, label %53, label %21
21: ; preds = %16
%22 = tail call double @my_atan2(double %10, double %9)
%23 = fneg double %19
%24 = tail call double @llvm.fmuladd.f64(double %23, double %19, double 8.000000e+00)
%25 = fmul double %24, 1.250000e-01
%26 = fptosi double %25 to i32
%27 = tail call double @acos(i32 %26)
store double %27, double* %6
%28 = tail call double @sin(double %27)
%29 = tail call double @llvm.fabs.f64(double %28)
%30 = fcmp olt double %29, 1.000000e-03
%31 = select i1 %30, double 0.000000e+00, double %28
%32 = tail call double @llvm.fabs.f64(double %31)
%33 = fcmp olt double %32, 1.000000e-03
%34 = tail call double @llvm.fabs.f64(double %19)
%35 = fcmp olt double %34, 1.000000e-03
%36 = select i1 %33, i1 %35, i1 false
br i1 %36, label %53, label %37
37: ; preds = %21
%38 = fmul double %31, 2.000000e+00
%39 = fdiv double %38, %19
%40 = fptosi double %39 to i32
%41 = tail call double @asin(i32 %40)
%42 = fsub double 0x3FF921FB544486E0, %41
%43 = fadd double %22, %42
%44 = tail call double @mod2pi(double %43)
store double %44, double* %5
%45 = load double, double* %6
%46 = fsub double %44, %45
%47 = fsub double %46, %2
%48 = tail call double @mod2pi(double %47)
store double %48, double* %7
%49 = load double, double* %5
%50 = load double, double* %6
%51 = fadd double %49, %50
%52 = fadd double %48, %51
br label %53
53: ; preds = %21, %16, %8, %37
%54 = phi double [ %52, %37 ], [ 1.000000e+04, %8 ], [ 1.000000e+04, %16 ], [ 1.000000e+04, %21 ]
ret double %54
}