#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(double);
double fabs(double);
double mod2pi(double);
double my_atan2(double, double);
double sqrt(double);
double c_c_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;
  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);
  alpha = acos(u1 / (4 * (1.0)));
  *t = mod2pi(1.5707963268 + alpha + theta);
  *u = mod2pi(3.1415926536 - 2 * alpha);
  *v = mod2pi(phi - *t - *u);
  length_rs = (1.0) * (*t + *u + *v);
  return (length_rs);
}


x86 assembly (clang, -O0):
<c_c_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 0xe96(%rip),%xmm0
pand   %xmm0,%xmm1
movsd  0xe5a(%rip),%xmm0
ucomisd %xmm1,%xmm0
jbe    11e4 <c_c_c+0xa4>
movsd  -0x58(%rbp),%xmm1
movaps 0xe74(%rip),%xmm0
pand   %xmm0,%xmm1
movsd  0xe38(%rip),%xmm0
ucomisd %xmm1,%xmm0
jbe    11e4 <c_c_c+0xa4>
movsd  0xe4e(%rip),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    12f8 <c_c_c+0x1b8>
movsd  -0x50(%rbp),%xmm0
movsd  -0x50(%rbp),%xmm2
movsd  -0x58(%rbp),%xmm1
mulsd  -0x58(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
call   1060 <sqrt@plt>
movsd  %xmm0,-0x60(%rbp)
movsd  -0x60(%rbp),%xmm0
movsd  0xdf1(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    1233 <c_c_c+0xf3>
movsd  0xdff(%rip),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    12f8 <c_c_c+0x1b8>
movsd  -0x58(%rbp),%xmm0
movsd  -0x50(%rbp),%xmm1
call   1050 <my_atan2@plt>
movsd  %xmm0,-0x68(%rbp)
movsd  -0x60(%rbp),%xmm0
movsd  0xdb4(%rip),%xmm1
divsd  %xmm1,%xmm0
call   1040 <acos@plt>
movsd  %xmm0,-0x70(%rbp)
movsd  0xdb6(%rip),%xmm0
addsd  -0x70(%rbp),%xmm0
addsd  -0x68(%rbp),%xmm0
call   1030 <mod2pi@plt>
mov    -0x38(%rbp),%rax
movsd  %xmm0,(%rax)
movsd  -0x70(%rbp),%xmm1
addsd  %xmm1,%xmm1
movsd  0xd86(%rip),%xmm0
subsd  %xmm1,%xmm0
call   1030 <mod2pi@plt>
mov    -0x40(%rbp),%rax
movsd  %xmm0,(%rax)
movsd  -0x20(%rbp),%xmm0
mov    -0x38(%rbp),%rax
subsd  (%rax),%xmm0
mov    -0x40(%rbp),%rax
subsd  (%rax),%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  0xd2b(%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):
<c_c_c>:
push   %r15
push   %r14
push   %rbx
sub    $0x30,%rsp
mov    %rdx,%r14
mov    %rsi,%r15
mov    %rdi,%rbx
movapd %xmm0,%xmm5
subsd  %xmm3,%xmm5
addsd  %xmm4,%xmm1
movapd 0xe9a(%rip),%xmm0
movapd %xmm5,%xmm3
andpd  %xmm0,%xmm3
movsd  0xe9a(%rip),%xmm4
ucomisd %xmm3,%xmm4
movsd  0xe96(%rip),%xmm6
jbe    1192 <c_c_c+0x52>
andpd  %xmm1,%xmm0
ucomisd %xmm0,%xmm4
ja     1290 <c_c_c+0x150>
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     11c9 <c_c_c+0x89>
sqrtsd %xmm0,%xmm0
ucomisd 0xe5e(%rip),%xmm0
jbe    11fa <c_c_c+0xba>
jmp    1290 <c_c_c+0x150>
movapd %xmm5,0x10(%rsp)
movapd %xmm1,(%rsp)
call   1060 <sqrt@plt>
movsd  0xe37(%rip),%xmm6
movapd (%rsp),%xmm1
movapd 0x10(%rsp),%xmm5
ucomisd 0xe2c(%rip),%xmm0
ja     1290 <c_c_c+0x150>
movsd  %xmm0,(%rsp)
movapd %xmm1,%xmm0
movapd %xmm5,%xmm1
call   1050 <my_atan2@plt>
movsd  %xmm0,0x10(%rsp)
movsd  (%rsp),%xmm0
mulsd  0xe09(%rip),%xmm0
call   1040 <acos@plt>
movapd %xmm0,%xmm1
movsd  %xmm0,(%rsp)
movsd  0xdfb(%rip),%xmm0
addsd  %xmm1,%xmm0
addsd  0x10(%rsp),%xmm0
call   1030 <mod2pi@plt>
movsd  %xmm0,(%rbx)
movsd  (%rsp),%xmm1
addsd  %xmm1,%xmm1
movsd  0xddf(%rip),%xmm0
subsd  %xmm1,%xmm0
call   1030 <mod2pi@plt>
movsd  %xmm0,(%r15)
movsd  0x28(%rsp),%xmm1
subsd  (%rbx),%xmm1
subsd  %xmm0,%xmm1
movapd %xmm1,%xmm0
call   1030 <mod2pi@plt>
movsd  %xmm0,(%r14)
movsd  (%rbx),%xmm6
addsd  (%r15),%xmm6
addsd  %xmm0,%xmm6
movapd %xmm6,%xmm0
add    $0x30,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define double @c_c_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
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
%24 = load double, double* %10
%25 = load double, double* %13
%26 = fsub double %24, %25
store double %26, double* %18
%27 = load double, double* %11
%28 = load double, double* %14
%29 = fadd double %27, %28
store double %29, double* %19
%30 = load double, double* %18
%31 = call double @llvm.fabs.f64(double %30)
%32 = fcmp olt double %31, 0x3D719799812DEA11
br i1 %32, label %33, label %38
33: ; preds = %8
%34 = load double, double* %19
%35 = call double @llvm.fabs.f64(double %34)
%36 = fcmp olt double %35, 0x3D719799812DEA11
br i1 %36, label %37, label %38
37: ; preds = %33
store double 1.000000e+04, double* %9
br label %85
38: ; preds = %33, %8
%39 = load double, double* %18
%40 = load double, double* %18
%41 = load double, double* %19
%42 = load double, double* %19
%43 = fmul double %41, %42
%44 = call double @llvm.fmuladd.f64(double %39, double %40, double %43)
%45 = call double @sqrt(double %44)
store double %45, double* %20
%46 = load double, double* %20
%47 = fcmp ogt double %46, 4.000000e+00
br i1 %47, label %48, label %49
48: ; preds = %38
store double 1.000000e+04, double* %9
br label %85
49: ; preds = %38
%50 = load double, double* %19
%51 = load double, double* %18
%52 = call double @my_atan2(double %50, double %51)
store double %52, double* %21
%53 = load double, double* %20
%54 = fdiv double %53, 4.000000e+00
%55 = call double @acos(double %54)
store double %55, double* %22
%56 = load double, double* %22
%57 = fadd double 0x3FF921FB544486E0, %56
%58 = load double, double* %21
%59 = fadd double %57, %58
%60 = call double @mod2pi(double %59)
%61 = load double*, double** %15
store double %60, double* %61
%62 = load double, double* %22
%63 = call double @llvm.fmuladd.f64(double -2.000000e+00, double %62, double 0x400921FB544486E0)
%64 = call double @mod2pi(double %63)
%65 = load double*, double** %16
store double %64, double* %65
%66 = load double, double* %12
%67 = load double*, double** %15
%68 = load double, double* %67
%69 = fsub double %66, %68
%70 = load double*, double** %16
%71 = load double, double* %70
%72 = fsub double %69, %71
%73 = call double @mod2pi(double %72)
%74 = load double*, double** %17
store double %73, double* %74
%75 = load double*, double** %15
%76 = load double, double* %75
%77 = load double*, double** %16
%78 = load double, double* %77
%79 = fadd double %76, %78
%80 = load double*, double** %17
%81 = load double, double* %80
%82 = fadd double %79, %81
%83 = fmul double 1.000000e+00, %82
store double %83, double* %23
%84 = load double, double* %23
store double %84, double* %9
br label %85
85: ; preds = %49, %48, %37
%86 = load double, double* %9
ret double %86
}

LLVM IR (-O2):
define double @c_c_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 %38, 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 %38, label %21
21: ; preds = %16
%22 = tail call double @my_atan2(double %10, double %9)
%23 = fmul double %19, 2.500000e-01
%24 = tail call double @acos(double %23)
%25 = fadd double %24, 0x3FF921FB544486E0
%26 = fadd double %22, %25
%27 = tail call double @mod2pi(double %26)
store double %27, double* %5
%28 = tail call double @llvm.fmuladd.f64(double %24, double -2.000000e+00, double 0x400921FB544486E0)
%29 = tail call double @mod2pi(double %28)
store double %29, double* %6
%30 = load double, double* %5
%31 = fsub double %2, %30
%32 = fsub double %31, %29
%33 = tail call double @mod2pi(double %32)
store double %33, double* %7
%34 = load double, double* %5
%35 = load double, double* %6
%36 = fadd double %34, %35
%37 = fadd double %33, %36
br label %38
38: ; preds = %16, %8, %21
%39 = phi double [ %37, %21 ], [ 1.000000e+04, %8 ], [ 1.000000e+04, %16 ]
ret double %39
}