#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 asin(int);
double fabs(double);
double mod2pi(double);
double my_atan2(double, double);
double sin(double);
double sqrt(double);
double c_cucu_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, va1, va2;
  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 > 6 * (1.0))
    return (10000);
  theta = my_atan2(b, a);
  va1 = (5 * ((1.0) * (1.0)) - u1 * u1 / 4) / (4 * (1.0) * (1.0));
  if ((va1 < 0.0) || (va1 > 1.0))
    return (10000);
  *u = acos(va1);
  va2 = sin(*u);
  alpha = asin((2 * (1.0)) * va2 / u1);
  *t = mod2pi(1.5707963268 + theta + alpha);
  *v = mod2pi(*t - phi);
  length_rs = (1.0) * (2 * (*u) + *t + *v);
  return (length_rs);
}


x86 assembly (clang, -O0):
<c_cucu_c>:
push   %rbp
mov    %rsp,%rbp
sub    $0x90,%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
addsd  -0x28(%rbp),%xmm0
movsd  %xmm0,-0x50(%rbp)
movsd  -0x18(%rbp),%xmm0
subsd  -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 <c_cucu_c+0xa4>
movsd  -0x58(%rbp),%xmm1
movaps 0xe64(%rip),%xmm0
pand   %xmm0,%xmm1
movsd  0xe18(%rip),%xmm0
ucomisd %xmm1,%xmm0
jbe    1204 <c_cucu_c+0xa4>
movsd  0xe3e(%rip),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    138f <c_cucu_c+0x22f>
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 <c_cucu_c+0xf3>
movsd  0xdef(%rip),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    138f <c_cucu_c+0x22f>
movsd  -0x58(%rbp),%xmm0
movsd  -0x50(%rbp),%xmm1
call   1070 <my_atan2@plt>
movsd  %xmm0,-0x68(%rbp)
movsd  -0x60(%rbp),%xmm1
mulsd  -0x60(%rbp),%xmm1
movsd  0xd97(%rip),%xmm0
divsd  %xmm0,%xmm1
movsd  0xd93(%rip),%xmm0
subsd  %xmm1,%xmm0
movsd  0xd7f(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x80(%rbp)
xorps  %xmm0,%xmm0
ucomisd -0x80(%rbp),%xmm0
ja     12bf <c_cucu_c+0x15f>
movsd  -0x80(%rbp),%xmm0
movsd  0xd6b(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    12d1 <c_cucu_c+0x171>
movsd  0xd71(%rip),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    138f <c_cucu_c+0x22f>
movsd  -0x80(%rbp),%xmm0
call   1040 <acos@plt>
mov    -0x40(%rbp),%rax
movsd  %xmm0,(%rax)
mov    -0x40(%rbp),%rax
movsd  (%rax),%xmm0
call   1050 <sin@plt>
movsd  %xmm0,-0x88(%rbp)
ff
movsd  0xd30(%rip),%xmm0
mulsd  -0x88(%rbp),%xmm0
ff
divsd  -0x60(%rbp),%xmm0
cvttsd2si %xmm0,%edi
call   1060 <asin@plt>
movsd  %xmm0,-0x70(%rbp)
movsd  0xd05(%rip),%xmm0
addsd  -0x68(%rbp),%xmm0
addsd  -0x70(%rbp),%xmm0
call   1030 <mod2pi@plt>
mov    -0x38(%rbp),%rax
movsd  %xmm0,(%rax)
mov    -0x38(%rbp),%rax
movsd  (%rax),%xmm0
subsd  -0x20(%rbp),%xmm0
call   1030 <mod2pi@plt>
mov    -0x48(%rbp),%rax
movsd  %xmm0,(%rax)
mov    -0x40(%rbp),%rax
movsd  (%rax),%xmm1
mov    -0x38(%rbp),%rax
movsd  (%rax),%xmm0
addsd  %xmm1,%xmm1
addsd  %xmm0,%xmm1
mov    -0x48(%rbp),%rax
addsd  (%rax),%xmm1
movsd  0xca4(%rip),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x78(%rbp)
movsd  -0x78(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
add    $0x90,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<c_cucu_c>:
push   %r15
push   %r14
push   %rbx
sub    $0x30,%rsp
mov    %rdx,%r15
mov    %rsi,%rbx
mov    %rdi,%r14
movapd %xmm0,%xmm5
addsd  %xmm3,%xmm5
subsd  %xmm4,%xmm1
movapd 0xe7a(%rip),%xmm0
movapd %xmm5,%xmm3
andpd  %xmm0,%xmm3
movsd  0xe7a(%rip),%xmm4
ucomisd %xmm3,%xmm4
movsd  0xe76(%rip),%xmm3
jbe    11b2 <c_cucu_c+0x52>
andpd  %xmm1,%xmm0
ucomisd %xmm0,%xmm4
ja     12e5 <c_cucu_c+0x185>
movapd %xmm1,%xmm4
mulsd  %xmm1,%xmm4
movapd %xmm5,%xmm0
mulsd  %xmm5,%xmm0
addsd  %xmm4,%xmm0
xorpd  %xmm4,%xmm4
ucomisd %xmm4,%xmm0
movsd  %xmm2,0x28(%rsp)
jb     11ec <c_cucu_c+0x8c>
xorps  %xmm2,%xmm2
sqrtsd %xmm0,%xmm2
ucomisd 0xe3b(%rip),%xmm2
jbe    1221 <c_cucu_c+0xc1>
jmp    12e5 <c_cucu_c+0x185>
movapd %xmm5,(%rsp)
movapd %xmm1,0x10(%rsp)
call   1080 <sqrt@plt>
movapd 0x10(%rsp),%xmm1
movapd (%rsp),%xmm5
movsd  0xe09(%rip),%xmm3
movapd %xmm0,%xmm2
ucomisd 0xe05(%rip),%xmm2
ja     12e5 <c_cucu_c+0x185>
movapd %xmm1,%xmm0
movapd %xmm5,%xmm1
movsd  %xmm2,(%rsp)
call   1070 <my_atan2@plt>
movsd  (%rsp),%xmm1
movapd %xmm0,%xmm5
mulsd  %xmm1,%xmm1
movsd  0xde0(%rip),%xmm2
mulsd  %xmm2,%xmm1
movsd  0xddc(%rip),%xmm0
subsd  %xmm1,%xmm0
mulsd  %xmm2,%xmm0
xorpd  %xmm1,%xmm1
ucomisd %xmm0,%xmm1
ja     12dd <c_cucu_c+0x17d>
ucomisd 0xdca(%rip),%xmm0
movsd  0xda2(%rip),%xmm3
ja     12e5 <c_cucu_c+0x185>
movsd  %xmm5,0x10(%rsp)
call   1040 <acos@plt>
movsd  %xmm0,(%rbx)
call   1050 <sin@plt>
addsd  %xmm0,%xmm0
divsd  (%rsp),%xmm0
cvttsd2si %xmm0,%edi
call   1060 <asin@plt>
movsd  0x10(%rsp),%xmm1
addsd  0xd94(%rip),%xmm1
addsd  %xmm1,%xmm0
call   1030 <mod2pi@plt>
movsd  %xmm0,(%r14)
subsd  0x28(%rsp),%xmm0
call   1030 <mod2pi@plt>
movsd  %xmm0,(%r15)
movsd  (%rbx),%xmm3
addsd  %xmm3,%xmm3
addsd  (%r14),%xmm3
addsd  %xmm0,%xmm3
jmp    12e5 <c_cucu_c+0x185>
movsd  0xd33(%rip),%xmm3
movapd %xmm3,%xmm0
add    $0x30,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define double @c_cucu_c(double %0, double %1, double %2, double %3, double %4, double* nocapture %5, double* nocapture %6, double* nocapture writeonly %7) {
%9 = fadd double %0, %3
%10 = fsub 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 %46, 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, 6.000000e+00
br i1 %20, label %46, label %21
21: ; preds = %16
%22 = tail call double @my_atan2(double %10, double %9)
%23 = fmul double %19, %19
%24 = fmul double %23, 2.500000e-01
%25 = fsub double 5.000000e+00, %24
%26 = fmul double %25, 2.500000e-01
%27 = fcmp olt double %26, 0.000000e+00
%28 = fcmp ogt double %26, 1.000000e+00
%29 = or i1 %27, %28
br i1 %29, label %46, label %30
30: ; preds = %21
%31 = tail call double @acos(double %26)
store double %31, double* %6
%32 = tail call double @sin(double %31)
%33 = fmul double %32, 2.000000e+00
%34 = fdiv double %33, %19
%35 = fptosi double %34 to i32
%36 = tail call double @asin(i32 %35)
%37 = fadd double %22, 0x3FF921FB544486E0
%38 = fadd double %37, %36
%39 = tail call double @mod2pi(double %38)
store double %39, double* %5
%40 = fsub double %39, %2
%41 = tail call double @mod2pi(double %40)
store double %41, double* %7
%42 = load double, double* %6
%43 = load double, double* %5
%44 = tail call double @llvm.fmuladd.f64(double %42, double 2.000000e+00, double %43)
%45 = fadd double %41, %44
br label %46
46: ; preds = %21, %16, %8, %30
%47 = phi double [ %45, %30 ], [ 1.000000e+04, %8 ], [ 1.000000e+04, %16 ], [ 1.000000e+04, %21 ]
ret double %47
}