int fct_curve(int ty, int orientation, double val, double *x1, double *y1,
              double *t1, double delta, double *pathx, double *pathy,
              double *patht, int n) {
  int i;
  double va1, va2, l, newval, incrt, remain;
  double center_x, center_y;
  double x2, y2, t2;
  int nnew;
  if (ty == 3)
    if (fabs(val / (1.0)) < 1.0e-12)
      return (0);
    else if (fabs(val) < 1.0e-12)
      return (0);
  switch (ty) {
  case 1:
    center_x = *x1 + (1.0) * sin(*t1);
    center_y = *y1 - (1.0) * cos(*t1);
    va1 = *t1 + 1.5707963268;
    if (orientation == 1)
      va2 = va1 - val;
    else
      va2 = va1 + val;
    x2 = center_x + (1.0) * cos(va2);
    y2 = center_y + (1.0) * sin(va2);
    t2 = *t1 - orientation * val;
    nnew = val / delta;
    remain = val - nnew * delta;
    nnew = nnew + n;
    if (orientation == -1)
      delta = -delta;
    incrt = 0;
    for (i = n; i < nnew; i++) {
      va1 = va1 - delta;
      *(pathx + i) = center_x + (1.0) * cos(va1);
      *(pathy + i) = center_y + (1.0) * sin(va1);
      incrt = incrt - delta;
      *(patht + i) = mod2pi(*t1 + incrt);
    }
    n = nnew;
    if (remain > fabs(delta) / 5.) {
      *(pathx + nnew) = x2;
      *(pathy + nnew) = y2;
      *(patht + nnew) = mod2pi(t2);
      n++;
    } else {
      *(pathx + nnew - 1) = x2;
      *(pathy + nnew - 1) = y2;
      *(patht + nnew - 1) = mod2pi(t2);
    }
    break;
  case 2:
    center_x = *x1 - (1.0) * sin(*t1);
    center_y = *y1 + (1.0) * cos(*t1);
    va1 = *t1 - 1.5707963268;
    if (orientation == 1)
      va2 = va1 + val;
    else
      va2 = va1 - val;
    x2 = center_x + (1.0) * cos(va2);
    y2 = center_y + (1.0) * sin(va2);
    t2 = *t1 + orientation * val;
    nnew = val / delta;
    remain = val - nnew * delta;
    nnew = nnew + n;
    if (orientation == -1)
      delta = -delta;
    incrt = 0;
    for (i = n; i < nnew; i++) {
      va1 = va1 + delta;
      *(pathx + i) = center_x + (1.0) * cos(va1);
      *(pathy + i) = center_y + (1.0) * sin(va1);
      incrt = incrt + delta;
      *(patht + i) = mod2pi(*t1 + incrt);
    }
    n = nnew;
    if (remain > fabs(delta) / 5.) {
      *(pathx + nnew) = x2;
      *(pathy + nnew) = y2;
      *(patht + nnew) = mod2pi(t2);
      n++;
    } else {
      *(pathx + nnew - 1) = x2;
      *(pathy + nnew - 1) = y2;
      *(patht + nnew - 1) = mod2pi(t2);
    }
    break;
  case 3:
    x2 = *x1 + orientation * val * cos(*t1);
    y2 = *y1 + orientation * val * sin(*t1);
    *t1 = mod2pi(*t1);
    t2 = *t1;
    va1 = sqrt((x2 - *x1) * (x2 - *x1) + (y2 - *y1) * (y2 - *y1));
    i = va1 / 1.2;
    remain = va1 - i * 1.2;
    nnew = n + i;
    newval = 1.2;
    va1 = orientation * cos(*t1);
    va2 = orientation * sin(*t1);
    for (i = n; i < nnew; i++) {
      *(pathx + i) = *x1 + va1 * newval;
      *(pathy + i) = *y1 + va2 * newval;
      *(patht + i) = *t1;
      newval = newval + 1.2;
    }
    if (remain > 0.4) {
      *(pathx + nnew) = x2;
      *(pathy + nnew) = y2;
      *(patht + nnew) = t2;
      n = nnew + 1;
    } else {
      *(pathx + nnew - 1) = x2;
      *(pathy + nnew - 1) = y2;
      *(patht + nnew - 1) = t2;
      n = nnew;
    }
  }
  *x1 = x2;
  *y1 = y2;
  *t1 = t2;
  return (n);
}


x86 assembly (clang, -O0):
<fct_curve>:
push   %rbp
mov    %rsp,%rbp
sub    $0x140,%rsp
mov    0x20(%rbp),%eax
mov    0x18(%rbp),%rax
mov    0x10(%rbp),%rax
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movsd  %xmm0,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    %rcx,-0x28(%rbp)
mov    %r8,-0x30(%rbp)
movsd  %xmm1,-0x38(%rbp)
mov    %r9,-0x40(%rbp)
cmpl   $0x3,-0x8(%rbp)
jne    11f2 <fct_curve+0xb2>
movsd  -0x18(%rbp),%xmm1
movsd  0xe7b(%rip),%xmm0
divsd  %xmm0,%xmm1
movaps 0xe98(%rip),%xmm0
pand   %xmm0,%xmm1
movsd  0xe5c(%rip),%xmm0
ucomisd %xmm1,%xmm0
jbe    11ba <fct_curve+0x7a>
movl   $0x0,-0x4(%rbp)
jmp    1c93 <fct_curve+0xb53>
movsd  -0x18(%rbp),%xmm1
movaps 0xe6a(%rip),%xmm0
pand   %xmm0,%xmm1
movsd  0xe2e(%rip),%xmm0
ucomisd %xmm1,%xmm0
jbe    11e8 <fct_curve+0xa8>
movl   $0x0,-0x4(%rbp)
jmp    1c93 <fct_curve+0xb53>
jmp    11ed <fct_curve+0xad>
jmp    11f2 <fct_curve+0xb2>
mov    -0x8(%rbp),%eax
mov    %eax,-0xa8(%rbp)
sub    $0x1,%eax
je     1231 <fct_curve+0xf1>
jmp    1209 <fct_curve+0xc9>
mov    -0xa8(%rbp),%eax
sub    $0x2,%eax
je     15ac <fct_curve+0x46c>
jmp    121d <fct_curve+0xdd>
mov    -0xa8(%rbp),%eax
sub    $0x3,%eax
je     1914 <fct_curve+0x7d4>
jmp    1c5d <fct_curve+0xb1d>
mov    -0x20(%rbp),%rax
movsd  (%rax),%xmm0
movsd  %xmm0,-0xb8(%rbp)
ff
mov    -0x30(%rbp),%rax
movsd  (%rax),%xmm0
call   1040 <sin@plt>
movsd  -0xb8(%rbp),%xmm1
ff
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x80(%rbp)
mov    -0x28(%rbp),%rax
movsd  (%rax),%xmm0
movsd  %xmm0,-0xb0(%rbp)
ff
mov    -0x30(%rbp),%rax
movsd  (%rax),%xmm0
call   1050 <cos@plt>
movaps %xmm0,%xmm1
movsd  -0xb0(%rbp),%xmm0
ff
subsd  %xmm1,%xmm0
movsd  %xmm0,-0x88(%rbp)
ff
mov    -0x30(%rbp),%rax
movsd  0xd81(%rip),%xmm0
addsd  (%rax),%xmm0
movsd  %xmm0,-0x50(%rbp)
cmpl   $0x1,-0xc(%rbp)
jne    12c6 <fct_curve+0x186>
movsd  -0x50(%rbp),%xmm0
subsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x58(%rbp)
jmp    12d5 <fct_curve+0x195>
movsd  -0x50(%rbp),%xmm0
addsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x58(%rbp)
movsd  -0x80(%rbp),%xmm0
movsd  %xmm0,-0xc8(%rbp)
ff
movsd  -0x58(%rbp),%xmm0
call   1050 <cos@plt>
movsd  -0xc8(%rbp),%xmm1
ff
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x90(%rbp)
ff
movsd  -0x88(%rbp),%xmm0
ff
movsd  %xmm0,-0xc0(%rbp)
ff
movsd  -0x58(%rbp),%xmm0
call   1040 <sin@plt>
movsd  -0xc0(%rbp),%xmm1
ff
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x98(%rbp)
ff
mov    -0x30(%rbp),%rax
movsd  (%rax),%xmm1
cvtsi2sdl -0xc(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm2
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0xa0(%rbp)
ff
movsd  -0x18(%rbp),%xmm0
divsd  -0x38(%rbp),%xmm0
cvttsd2si %xmm0,%eax
mov    %eax,-0xa4(%rbp)
movsd  -0x18(%rbp),%xmm1
cvtsi2sdl -0xa4(%rbp),%xmm0
ff
movsd  -0x38(%rbp),%xmm2
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x78(%rbp)
mov    -0xa4(%rbp),%eax
add    0x20(%rbp),%eax
mov    %eax,-0xa4(%rbp)
cmpl   $0xffffffff,-0xc(%rbp)
jne    13eb <fct_curve+0x2ab>
movsd  -0x38(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  %xmm0,-0x38(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x70(%rbp)
mov    0x20(%rbp),%eax
mov    %eax,-0x44(%rbp)
mov    -0x44(%rbp),%eax
cmp    -0xa4(%rbp),%eax
jge    14bc <fct_curve+0x37c>
movsd  -0x50(%rbp),%xmm0
subsd  -0x38(%rbp),%xmm0
movsd  %xmm0,-0x50(%rbp)
movsd  -0x80(%rbp),%xmm0
movsd  %xmm0,-0xd8(%rbp)
ff
movsd  -0x50(%rbp),%xmm0
call   1050 <cos@plt>
movsd  -0xd8(%rbp),%xmm1
ff
addsd  %xmm1,%xmm0
mov    -0x40(%rbp),%rax
movslq -0x44(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
movsd  -0x88(%rbp),%xmm0
ff
movsd  %xmm0,-0xd0(%rbp)
ff
movsd  -0x50(%rbp),%xmm0
call   1040 <sin@plt>
movsd  -0xd0(%rbp),%xmm1
ff
addsd  %xmm1,%xmm0
mov    0x10(%rbp),%rax
movslq -0x44(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
movsd  -0x70(%rbp),%xmm0
subsd  -0x38(%rbp),%xmm0
movsd  %xmm0,-0x70(%rbp)
mov    -0x30(%rbp),%rax
movsd  (%rax),%xmm0
addsd  -0x70(%rbp),%xmm0
mov    $0x1,%al
call   1030 <mod2pi@plt>
cvtsi2sd %eax,%xmm0
mov    0x18(%rbp),%rax
movslq -0x44(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x44(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x44(%rbp)
jmp    13f9 <fct_curve+0x2b9>
mov    -0xa4(%rbp),%eax
mov    %eax,0x20(%rbp)
movsd  -0x78(%rbp),%xmm0
movsd  -0x38(%rbp),%xmm1
movaps 0xb5a(%rip),%xmm2
pand   %xmm2,%xmm1
movsd  0xb46(%rip),%xmm2
divsd  %xmm2,%xmm1
ucomisd %xmm1,%xmm0
jbe    1551 <fct_curve+0x411>
movsd  -0x90(%rbp),%xmm0
ff
mov    -0x40(%rbp),%rax
movslq -0xa4(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
movsd  -0x98(%rbp),%xmm0
ff
mov    0x10(%rbp),%rax
movslq -0xa4(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
movsd  -0xa0(%rbp),%xmm0
ff
mov    $0x1,%al
call   1030 <mod2pi@plt>
cvtsi2sd %eax,%xmm0
mov    0x18(%rbp),%rax
movslq -0xa4(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,0x20(%rbp)
jmp    15a7 <fct_curve+0x467>
movsd  -0x90(%rbp),%xmm0
ff
mov    -0x40(%rbp),%rax
movslq -0xa4(%rbp),%rcx
movsd  %xmm0,-0x8(%rax,%rcx,8)
movsd  -0x98(%rbp),%xmm0
ff
mov    0x10(%rbp),%rax
movslq -0xa4(%rbp),%rcx
movsd  %xmm0,-0x8(%rax,%rcx,8)
movsd  -0xa0(%rbp),%xmm0
ff
mov    $0x1,%al
call   1030 <mod2pi@plt>
cvtsi2sd %eax,%xmm0
mov    0x18(%rbp),%rax
movslq -0xa4(%rbp),%rcx
movsd  %xmm0,-0x8(%rax,%rcx,8)
jmp    1c5d <fct_curve+0xb1d>
mov    -0x20(%rbp),%rax
movsd  (%rax),%xmm0
movsd  %xmm0,-0xe8(%rbp)
ff
mov    -0x30(%rbp),%rax
movsd  (%rax),%xmm0
call   1040 <sin@plt>
movaps %xmm0,%xmm1
movsd  -0xe8(%rbp),%xmm0
ff
subsd  %xmm1,%xmm0
movsd  %xmm0,-0x80(%rbp)
mov    -0x28(%rbp),%rax
movsd  (%rax),%xmm0
movsd  %xmm0,-0xe0(%rbp)
ff
mov    -0x30(%rbp),%rax
movsd  (%rax),%xmm0
call   1050 <cos@plt>
movsd  -0xe0(%rbp),%xmm1
ff
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x88(%rbp)
ff
mov    -0x30(%rbp),%rax
movsd  (%rax),%xmm0
movsd  0xa02(%rip),%xmm1
subsd  %xmm1,%xmm0
movsd  %xmm0,-0x50(%rbp)
cmpl   $0x1,-0xc(%rbp)
jne    1645 <fct_curve+0x505>
movsd  -0x50(%rbp),%xmm0
addsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x58(%rbp)
jmp    1654 <fct_curve+0x514>
movsd  -0x50(%rbp),%xmm0
subsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x58(%rbp)
movsd  -0x80(%rbp),%xmm0
movsd  %xmm0,-0xf8(%rbp)
ff
movsd  -0x58(%rbp),%xmm0
call   1050 <cos@plt>
movsd  -0xf8(%rbp),%xmm1
ff
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x90(%rbp)
ff
movsd  -0x88(%rbp),%xmm0
ff
movsd  %xmm0,-0xf0(%rbp)
ff
movsd  -0x58(%rbp),%xmm0
call   1040 <sin@plt>
movsd  -0xf0(%rbp),%xmm1
ff
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x98(%rbp)
ff
mov    -0x30(%rbp),%rax
movsd  (%rax),%xmm1
cvtsi2sdl -0xc(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0xa0(%rbp)
ff
movsd  -0x18(%rbp),%xmm0
divsd  -0x38(%rbp),%xmm0
cvttsd2si %xmm0,%eax
mov    %eax,-0xa4(%rbp)
movsd  -0x18(%rbp),%xmm1
cvtsi2sdl -0xa4(%rbp),%xmm0
ff
movsd  -0x38(%rbp),%xmm2
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x78(%rbp)
mov    -0xa4(%rbp),%eax
add    0x20(%rbp),%eax
mov    %eax,-0xa4(%rbp)
cmpl   $0xffffffff,-0xc(%rbp)
jne    1753 <fct_curve+0x613>
movsd  -0x38(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  %xmm0,-0x38(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x70(%rbp)
mov    0x20(%rbp),%eax
mov    %eax,-0x44(%rbp)
mov    -0x44(%rbp),%eax
cmp    -0xa4(%rbp),%eax
jge    1824 <fct_curve+0x6e4>
movsd  -0x50(%rbp),%xmm0
addsd  -0x38(%rbp),%xmm0
movsd  %xmm0,-0x50(%rbp)
movsd  -0x80(%rbp),%xmm0
movsd  %xmm0,-0x108(%rbp)
ff
movsd  -0x50(%rbp),%xmm0
call   1050 <cos@plt>
movsd  -0x108(%rbp),%xmm1
ff
addsd  %xmm1,%xmm0
mov    -0x40(%rbp),%rax
movslq -0x44(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
movsd  -0x88(%rbp),%xmm0
ff
movsd  %xmm0,-0x100(%rbp)
ff
movsd  -0x50(%rbp),%xmm0
call   1040 <sin@plt>
movsd  -0x100(%rbp),%xmm1
ff
addsd  %xmm1,%xmm0
mov    0x10(%rbp),%rax
movslq -0x44(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
movsd  -0x70(%rbp),%xmm0
addsd  -0x38(%rbp),%xmm0
movsd  %xmm0,-0x70(%rbp)
mov    -0x30(%rbp),%rax
movsd  (%rax),%xmm0
addsd  -0x70(%rbp),%xmm0
mov    $0x1,%al
call   1030 <mod2pi@plt>
cvtsi2sd %eax,%xmm0
mov    0x18(%rbp),%rax
movslq -0x44(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x44(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x44(%rbp)
jmp    1761 <fct_curve+0x621>
mov    -0xa4(%rbp),%eax
mov    %eax,0x20(%rbp)
movsd  -0x78(%rbp),%xmm0
movsd  -0x38(%rbp),%xmm1
movaps 0x7f2(%rip),%xmm2
pand   %xmm2,%xmm1
movsd  0x7de(%rip),%xmm2
divsd  %xmm2,%xmm1
ucomisd %xmm1,%xmm0
jbe    18b9 <fct_curve+0x779>
movsd  -0x90(%rbp),%xmm0
ff
mov    -0x40(%rbp),%rax
movslq -0xa4(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
movsd  -0x98(%rbp),%xmm0
ff
mov    0x10(%rbp),%rax
movslq -0xa4(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
movsd  -0xa0(%rbp),%xmm0
ff
mov    $0x1,%al
call   1030 <mod2pi@plt>
cvtsi2sd %eax,%xmm0
mov    0x18(%rbp),%rax
movslq -0xa4(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,0x20(%rbp)
jmp    190f <fct_curve+0x7cf>
movsd  -0x90(%rbp),%xmm0
ff
mov    -0x40(%rbp),%rax
movslq -0xa4(%rbp),%rcx
movsd  %xmm0,-0x8(%rax,%rcx,8)
movsd  -0x98(%rbp),%xmm0
ff
mov    0x10(%rbp),%rax
movslq -0xa4(%rbp),%rcx
movsd  %xmm0,-0x8(%rax,%rcx,8)
movsd  -0xa0(%rbp),%xmm0
ff
mov    $0x1,%al
call   1030 <mod2pi@plt>
cvtsi2sd %eax,%xmm0
mov    0x18(%rbp),%rax
movslq -0xa4(%rbp),%rcx
movsd  %xmm0,-0x8(%rax,%rcx,8)
jmp    1c5d <fct_curve+0xb1d>
mov    -0x20(%rbp),%rax
movsd  (%rax),%xmm0
movsd  %xmm0,-0x138(%rbp)
ff
cvtsi2sdl -0xc(%rbp),%xmm0
mulsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x130(%rbp)
ff
mov    -0x30(%rbp),%rax
movsd  (%rax),%xmm0
call   1050 <cos@plt>
movsd  -0x138(%rbp),%xmm1
ff
movaps %xmm0,%xmm2
movsd  -0x130(%rbp),%xmm0
ff
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x90(%rbp)
ff
mov    -0x28(%rbp),%rax
movsd  (%rax),%xmm0
movsd  %xmm0,-0x128(%rbp)
ff
cvtsi2sdl -0xc(%rbp),%xmm0
mulsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x120(%rbp)
ff
mov    -0x30(%rbp),%rax
movsd  (%rax),%xmm0
call   1040 <sin@plt>
movsd  -0x128(%rbp),%xmm1
ff
movaps %xmm0,%xmm2
movsd  -0x120(%rbp),%xmm0
ff
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x98(%rbp)
ff
mov    -0x30(%rbp),%rax
movsd  (%rax),%xmm0
mov    $0x1,%al
call   1030 <mod2pi@plt>
cvtsi2sd %eax,%xmm0
mov    -0x30(%rbp),%rax
movsd  %xmm0,(%rax)
mov    -0x30(%rbp),%rax
movsd  (%rax),%xmm0
movsd  %xmm0,-0xa0(%rbp)
ff
movsd  -0x90(%rbp),%xmm0
ff
mov    -0x20(%rbp),%rax
subsd  (%rax),%xmm0
movsd  -0x90(%rbp),%xmm2
ff
mov    -0x20(%rbp),%rax
subsd  (%rax),%xmm2
movsd  -0x98(%rbp),%xmm1
ff
mov    -0x28(%rbp),%rax
subsd  (%rax),%xmm1
movsd  -0x98(%rbp),%xmm3
ff
mov    -0x28(%rbp),%rax
subsd  (%rax),%xmm3
mulsd  %xmm3,%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
call   1060 <sqrt@plt>
movsd  %xmm0,-0x50(%rbp)
movsd  -0x50(%rbp),%xmm0
movsd  0x5ca(%rip),%xmm1
divsd  %xmm1,%xmm0
cvttsd2si %xmm0,%eax
mov    %eax,-0x44(%rbp)
movsd  -0x50(%rbp),%xmm1
cvtsi2sdl -0x44(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  0x596(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x78(%rbp)
mov    0x20(%rbp),%eax
add    -0x44(%rbp),%eax
mov    %eax,-0xa4(%rbp)
movsd  0x575(%rip),%xmm0
movsd  %xmm0,-0x68(%rbp)
cvtsi2sdl -0xc(%rbp),%xmm0
movsd  %xmm0,-0x118(%rbp)
ff
mov    -0x30(%rbp),%rax
movsd  (%rax),%xmm0
call   1050 <cos@plt>
movaps %xmm0,%xmm1
movsd  -0x118(%rbp),%xmm0
ff
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x50(%rbp)
cvtsi2sdl -0xc(%rbp),%xmm0
movsd  %xmm0,-0x110(%rbp)
ff
mov    -0x30(%rbp),%rax
movsd  (%rax),%xmm0
call   1040 <sin@plt>
movaps %xmm0,%xmm1
movsd  -0x110(%rbp),%xmm0
ff
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x58(%rbp)
mov    0x20(%rbp),%eax
mov    %eax,-0x44(%rbp)
mov    -0x44(%rbp),%eax
cmp    -0xa4(%rbp),%eax
jge    1b94 <fct_curve+0xa54>
mov    -0x20(%rbp),%rax
movsd  (%rax),%xmm1
movsd  -0x50(%rbp),%xmm0
movsd  -0x68(%rbp),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
mov    -0x40(%rbp),%rax
movslq -0x44(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x28(%rbp),%rax
movsd  (%rax),%xmm1
movsd  -0x58(%rbp),%xmm0
movsd  -0x68(%rbp),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
mov    0x10(%rbp),%rax
movslq -0x44(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x30(%rbp),%rax
movsd  (%rax),%xmm0
mov    0x18(%rbp),%rax
movslq -0x44(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
movsd  0x494(%rip),%xmm0
addsd  -0x68(%rbp),%xmm0
movsd  %xmm0,-0x68(%rbp)
mov    -0x44(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x44(%rbp)
jmp    1b02 <fct_curve+0x9c2>
movsd  -0x78(%rbp),%xmm0
movsd  0x477(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    1c04 <fct_curve+0xac4>
movsd  -0x90(%rbp),%xmm0
ff
mov    -0x40(%rbp),%rax
movslq -0xa4(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
movsd  -0x98(%rbp),%xmm0
ff
mov    0x10(%rbp),%rax
movslq -0xa4(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
movsd  -0xa0(%rbp),%xmm0
ff
mov    0x18(%rbp),%rax
movslq -0xa4(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0xa4(%rbp),%eax
add    $0x1,%eax
mov    %eax,0x20(%rbp)
jmp    1c58 <fct_curve+0xb18>
movsd  -0x90(%rbp),%xmm0
ff
mov    -0x40(%rbp),%rax
movslq -0xa4(%rbp),%rcx
movsd  %xmm0,-0x8(%rax,%rcx,8)
movsd  -0x98(%rbp),%xmm0
ff
mov    0x10(%rbp),%rax
movslq -0xa4(%rbp),%rcx
movsd  %xmm0,-0x8(%rax,%rcx,8)
movsd  -0xa0(%rbp),%xmm0
ff
mov    0x18(%rbp),%rax
movslq -0xa4(%rbp),%rcx
movsd  %xmm0,-0x8(%rax,%rcx,8)
mov    -0xa4(%rbp),%eax
mov    %eax,0x20(%rbp)
jmp    1c5d <fct_curve+0xb1d>
movsd  -0x90(%rbp),%xmm0
ff
mov    -0x20(%rbp),%rax
movsd  %xmm0,(%rax)
movsd  -0x98(%rbp),%xmm0
ff
mov    -0x28(%rbp),%rax
movsd  %xmm0,(%rax)
movsd  -0xa0(%rbp),%xmm0
ff
mov    -0x30(%rbp),%rax
movsd  %xmm0,(%rax)
mov    0x20(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x140,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fct_curve>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x88,%rsp
mov    %r9,%r12
mov    %r8,%r14
mov    %rcx,%rbp
mov    %rdx,%rbx
movapd %xmm0,%xmm2
mov    %esi,%r13d
mov    0xd0(%rsp),%eax
mov    0xc0(%rsp),%r15
cmp    $0x1,%edi
je     126c <fct_curve+0x12c>
cmp    $0x2,%edi
je     12cd <fct_curve+0x18d>
cmp    $0x3,%edi
jne    13b7 <fct_curve+0x277>
movapd 0xeaa(%rip),%xmm0
andpd  %xmm2,%xmm0
xor    %eax,%eax
movsd  0xe74(%rip),%xmm1
ucomisd %xmm0,%xmm1
ja     1978 <fct_curve+0x838>
movsd  (%rbx),%xmm0
movsd  %xmm0,0x10(%rsp)
xorps  %xmm0,%xmm0
cvtsi2sd %r13d,%xmm0
movsd  %xmm0,0x20(%rsp)
mulsd  %xmm0,%xmm2
movapd %xmm2,0x30(%rsp)
movsd  (%r14),%xmm0
call   1050 <cos@plt>
mulsd  0x30(%rsp),%xmm0
addsd  0x10(%rsp),%xmm0
movsd  %xmm0,0x8(%rsp)
movsd  0x0(%rbp),%xmm0
movsd  %xmm0,0x10(%rsp)
movsd  (%r14),%xmm0
call   1040 <sin@plt>
mulsd  0x30(%rsp),%xmm0
addsd  0x10(%rsp),%xmm0
movsd  %xmm0,(%rsp)
movsd  (%r14),%xmm0
mov    $0x1,%al
call   1030 <mod2pi@plt>
xorps  %xmm2,%xmm2
cvtsi2sd %eax,%xmm2
movsd  %xmm2,(%r14)
movsd  0x8(%rsp),%xmm0
subsd  (%rbx),%xmm0
movsd  (%rsp),%xmm1
subsd  0x0(%rbp),%xmm1
mulsd  %xmm1,%xmm1
mulsd  %xmm0,%xmm0
addsd  %xmm1,%xmm0
xorpd  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
mov    %rbx,0x28(%rsp)
movsd  %xmm2,0x18(%rsp)
jb     182e <fct_curve+0x6ee>
sqrtsd %xmm0,%xmm0
jmp    1833 <fct_curve+0x6f3>
movaps %xmm1,0x70(%rsp)
movapd %xmm2,0x30(%rsp)
movsd  (%rbx),%xmm0
movsd  %xmm0,0x8(%rsp)
movsd  (%r14),%xmm0
call   1040 <sin@plt>
movsd  %xmm0,0x20(%rsp)
movsd  0x0(%rbp),%xmm0
movsd  %xmm0,(%rsp)
movsd  (%r14),%xmm0
call   1050 <cos@plt>
movsd  %xmm0,0x18(%rsp)
movsd  (%r14),%xmm1
addsd  0xd58(%rip),%xmm1
cmp    $0x1,%r13d
je     13bc <fct_curve+0x27c>
movapd 0x30(%rsp),%xmm0
jmp    13ca <fct_curve+0x28a>
movaps %xmm1,0x70(%rsp)
movsd  (%rbx),%xmm0
movsd  %xmm0,0x8(%rsp)
movsd  (%r14),%xmm0
movapd %xmm2,0x30(%rsp)
call   1040 <sin@plt>
movsd  %xmm0,0x20(%rsp)
movsd  0x0(%rbp),%xmm0
movsd  %xmm0,(%rsp)
movsd  (%r14),%xmm0
call   1050 <cos@plt>
movapd 0x30(%rsp),%xmm1
movsd  %xmm0,0x50(%rsp)
movsd  (%r14),%xmm2
addsd  0xce1(%rip),%xmm2
movapd %xmm1,%xmm0
cmp    $0x1,%r13d
je     1335 <fct_curve+0x1f5>
movapd %xmm1,%xmm0
xorpd  0xcfb(%rip),%xmm0
movsd  %xmm2,0x10(%rsp)
addsd  %xmm2,%xmm0
movapd %xmm0,0x40(%rsp)
call   1050 <cos@plt>
movsd  %xmm0,0x68(%rsp)
movaps 0x40(%rsp),%xmm0
call   1040 <sin@plt>
movapd 0x30(%rsp),%xmm3
xorps  %xmm2,%xmm2
cvtsi2sd %r13d,%xmm2
movsd  %xmm0,0x60(%rsp)
movapd %xmm3,%xmm0
movapd 0x70(%rsp),%xmm1
divsd  %xmm1,%xmm0
cvttsd2si %xmm0,%eax
cvttpd2dq %xmm0,%xmm0
cvtdq2pd %xmm0,%xmm0
mulsd  %xmm3,%xmm2
mulsd  %xmm1,%xmm0
mov    0xd0(%rsp),%edx
lea    (%rax,%rdx,1),%ecx
cmp    $0xffffffff,%r13d
mov    %rbx,0x28(%rsp)
mov    %rbp,0x58(%rsp)
je     1448 <fct_curve+0x308>
movapd %xmm1,%xmm4
jmp    1454 <fct_curve+0x314>
jmp    196a <fct_curve+0x82a>
movapd 0x30(%rsp),%xmm0
xorpd  0xc66(%rip),%xmm0
mov    %rbx,0x28(%rsp)
movsd  %xmm1,0x10(%rsp)
addsd  %xmm1,%xmm0
movapd %xmm0,0x40(%rsp)
call   1050 <cos@plt>
movsd  %xmm0,0x68(%rsp)
movaps 0x40(%rsp),%xmm0
call   1040 <sin@plt>
cvtsi2sd %r13d,%xmm5
movapd 0x30(%rsp),%xmm3
movapd %xmm3,%xmm1
movapd 0x70(%rsp),%xmm2
divsd  %xmm2,%xmm1
cvttsd2si %xmm1,%eax
cvttpd2dq %xmm1,%xmm1
cvtdq2pd %xmm1,%xmm1
movsd  %xmm0,0x80(%rsp)
mulsd  %xmm2,%xmm1
mov    0xd0(%rsp),%edx
lea    (%rax,%rdx,1),%ecx
cmp    $0xffffffff,%r13d
mov    %rbp,0x58(%rsp)
je     15de <fct_curve+0x49e>
movapd %xmm2,%xmm4
jmp    15ea <fct_curve+0x4aa>
movapd 0xbe0(%rip),%xmm4
xorpd  %xmm1,%xmm4
movsd  (%rsp),%xmm1
movsd  0x8(%rsp),%xmm5
subsd  0x20(%rsp),%xmm5
movsd  %xmm5,0x8(%rsp)
addsd  (%r14),%xmm2
movsd  %xmm2,0x18(%rsp)
addsd  0x50(%rsp),%xmm1
movsd  %xmm1,(%rsp)
subsd  %xmm0,%xmm3
movapd %xmm3,0x30(%rsp)
mov    %ecx,0x50(%rsp)
movslq %ecx,%rbp
test   %eax,%eax
mov    0xc8(%rsp),%r13
movsd  0x10(%rsp),%xmm0
jle    153c <fct_curve+0x3fc>
movslq %edx,%rbx
xorpd  %xmm1,%xmm1
movsd  %xmm1,0x20(%rsp)
movapd %xmm4,0x40(%rsp)
nopl   0x0(%rax,%rax,1)
addsd  %xmm4,%xmm0
movsd  %xmm0,0x10(%rsp)
movsd  0x10(%rsp),%xmm0
call   1050 <cos@plt>
addsd  0x8(%rsp),%xmm0
movsd  %xmm0,(%r12,%rbx,8)
movsd  0x10(%rsp),%xmm0
call   1040 <sin@plt>
addsd  (%rsp),%xmm0
movsd  %xmm0,(%r15,%rbx,8)
movsd  0x20(%rsp),%xmm1
addsd  0x40(%rsp),%xmm1
movsd  (%r14),%xmm0
movsd  %xmm1,0x20(%rsp)
addsd  %xmm1,%xmm0
mov    $0x1,%al
call   1030 <mod2pi@plt>
movapd 0x40(%rsp),%xmm4
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
movsd  %xmm0,0x0(%r13,%rbx,8)
movsd  0x10(%rsp),%xmm0
add    $0x1,%rbx
cmp    %rbp,%rbx
jl     14c0 <fct_curve+0x380>
movsd  0x8(%rsp),%xmm2
addsd  0x68(%rsp),%xmm2
movsd  (%rsp),%xmm3
addsd  0x60(%rsp),%xmm3
movapd 0x70(%rsp),%xmm1
andpd  0xadf(%rip),%xmm1
divsd  0xa9f(%rip),%xmm1
movapd 0x30(%rsp),%xmm0
ucomisd %xmm1,%xmm0
movapd %xmm2,%xmm0
movapd %xmm3,%xmm1
movsd  %xmm2,0x8(%rsp)
movsd  %xmm3,(%rsp)
jbe    178c <fct_curve+0x64c>
movsd  %xmm0,(%r12,%rbp,8)
movsd  %xmm1,(%r15,%rbp,8)
movsd  0x18(%rsp),%xmm0
mov    $0x1,%al
call   1030 <mod2pi@plt>
movsd  0x18(%rsp),%xmm2
movsd  (%rsp),%xmm1
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
mov    0xc8(%rsp),%rax
movsd  %xmm0,(%rax,%rbp,8)
movsd  0x8(%rsp),%xmm0
add    $0x1,%ebp
mov    %ebp,%eax
mov    0x28(%rsp),%rbx
mov    0x58(%rsp),%rbp
jmp    196a <fct_curve+0x82a>
movapd 0xa4a(%rip),%xmm4
xorpd  %xmm2,%xmm4
movsd  0x8(%rsp),%xmm0
addsd  0x20(%rsp),%xmm0
movsd  %xmm0,0x8(%rsp)
movsd  (%rsp),%xmm2
subsd  0x18(%rsp),%xmm2
movsd  %xmm2,(%rsp)
movsd  (%r14),%xmm2
movsd  %xmm2,0x18(%rsp)
mulsd  %xmm3,%xmm5
movsd  %xmm5,0x60(%rsp)
subsd  %xmm1,%xmm3
movapd %xmm3,0x30(%rsp)
mov    %ecx,0x50(%rsp)
movslq %ecx,%rbp
test   %eax,%eax
mov    0xc8(%rsp),%rbx
movsd  0x10(%rsp),%xmm0
jle    16db <fct_curve+0x59b>
movslq %edx,%r13
xorpd  %xmm1,%xmm1
movsd  %xmm1,0x20(%rsp)
movapd %xmm4,0x40(%rsp)
nopl   0x0(%rax,%rax,1)
subsd  %xmm4,%xmm0
movsd  %xmm0,0x10(%rsp)
movsd  0x10(%rsp),%xmm0
call   1050 <cos@plt>
addsd  0x8(%rsp),%xmm0
movsd  %xmm0,(%r12,%r13,8)
movsd  0x10(%rsp),%xmm0
call   1040 <sin@plt>
addsd  (%rsp),%xmm0
movsd  %xmm0,(%r15,%r13,8)
movsd  0x20(%rsp),%xmm1
subsd  0x40(%rsp),%xmm1
movsd  (%r14),%xmm0
movsd  %xmm1,0x20(%rsp)
addsd  %xmm1,%xmm0
mov    $0x1,%al
call   1030 <mod2pi@plt>
movapd 0x40(%rsp),%xmm4
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
movsd  %xmm0,(%rbx,%r13,8)
movsd  0x10(%rsp),%xmm0
add    $0x1,%r13
cmp    %rbp,%r13
jl     1660 <fct_curve+0x520>
movsd  0x8(%rsp),%xmm4
addsd  0x68(%rsp),%xmm4
movsd  (%rsp),%xmm3
addsd  0x80(%rsp),%xmm3
movsd  0x18(%rsp),%xmm0
subsd  0x60(%rsp),%xmm0
movapd 0x70(%rsp),%xmm2
andpd  0x931(%rip),%xmm2
divsd  0x8f1(%rip),%xmm2
movapd 0x30(%rsp),%xmm1
ucomisd %xmm2,%xmm1
movapd %xmm4,%xmm2
movapd %xmm3,%xmm1
movsd  %xmm4,0x8(%rsp)
movsd  %xmm3,(%rsp)
movsd  %xmm0,0x18(%rsp)
jbe    17e0 <fct_curve+0x6a0>
movsd  %xmm2,(%r12,%rbp,8)
movsd  %xmm1,(%r15,%rbp,8)
mov    $0x1,%al
call   1030 <mod2pi@plt>
movsd  0x18(%rsp),%xmm2
movsd  (%rsp),%xmm1
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
mov    0xc8(%rsp),%rax
movsd  %xmm0,(%rax,%rbp,8)
movsd  0x8(%rsp),%xmm0
add    $0x1,%ebp
mov    %ebp,%eax
mov    0x58(%rsp),%rbp
mov    0x28(%rsp),%rbx
jmp    196a <fct_curve+0x82a>
movsd  %xmm0,-0x8(%r12,%rbp,8)
movsd  %xmm1,-0x8(%r15,%rbp,8)
movsd  0x18(%rsp),%xmm0
mov    $0x1,%al
call   1030 <mod2pi@plt>
movsd  0x18(%rsp),%xmm2
movsd  (%rsp),%xmm1
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
mov    0xc8(%rsp),%rax
movsd  %xmm0,-0x8(%rax,%rbp,8)
movsd  0x8(%rsp),%xmm0
mov    0x28(%rsp),%rbx
mov    0x58(%rsp),%rbp
mov    0x50(%rsp),%eax
jmp    196a <fct_curve+0x82a>
movsd  %xmm2,-0x8(%r12,%rbp,8)
movsd  %xmm1,-0x8(%r15,%rbp,8)
mov    $0x1,%al
call   1030 <mod2pi@plt>
movsd  0x18(%rsp),%xmm2
movsd  (%rsp),%xmm1
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
mov    0xc8(%rsp),%rax
movsd  %xmm0,-0x8(%rax,%rbp,8)
movsd  0x8(%rsp),%xmm0
mov    0x58(%rsp),%rbp
mov    0x28(%rsp),%rbx
mov    0x50(%rsp),%eax
jmp    196a <fct_curve+0x82a>
call   1060 <sqrt@plt>
mov    0xd0(%rsp),%eax
movsd  0x7de(%rip),%xmm2
movapd %xmm0,%xmm1
divsd  %xmm2,%xmm1
cvttsd2si %xmm1,%ebx
cvttpd2dq %xmm1,%xmm1
cvtdq2pd %xmm1,%xmm1
mulsd  %xmm2,%xmm1
subsd  %xmm1,%xmm0
movsd  %xmm0,0x10(%rsp)
lea    (%rbx,%rax,1),%r13d
movsd  (%r14),%xmm0
call   1050 <cos@plt>
movsd  %xmm0,0x40(%rsp)
movsd  (%r14),%xmm0
call   1040 <sin@plt>
movsd  0x40(%rsp),%xmm4
movsd  0x790(%rip),%xmm3
mov    %r13d,%eax
movslq %r13d,%rsi
test   %ebx,%ebx
mov    0x28(%rsp),%rbx
mov    0xc8(%rsp),%rdx
jle    190c <fct_curve+0x7cc>
movsd  0x20(%rsp),%xmm1
mulsd  %xmm1,%xmm4
mulsd  %xmm1,%xmm0
mov    0xd0(%rsp),%ecx
movslq %ecx,%rcx
movapd %xmm3,%xmm1
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
movapd %xmm4,%xmm2
mulsd  %xmm1,%xmm2
addsd  (%rbx),%xmm2
movsd  %xmm2,(%r12,%rcx,8)
movapd %xmm0,%xmm2
mulsd  %xmm1,%xmm2
addsd  0x0(%rbp),%xmm2
movsd  %xmm2,(%r15,%rcx,8)
movsd  (%r14),%xmm2
movsd  %xmm2,(%rdx,%rcx,8)
addsd  %xmm3,%xmm1
add    $0x1,%rcx
cmp    %rsi,%rcx
jl     18d0 <fct_curve+0x790>
movsd  0x10(%rsp),%xmm0
ucomisd 0x70e(%rip),%xmm0
jbe    1945 <fct_curve+0x805>
movsd  0x8(%rsp),%xmm0
movsd  %xmm0,(%r12,%rsi,8)
movsd  (%rsp),%xmm1
movsd  %xmm1,(%r15,%rsi,8)
movsd  0x18(%rsp),%xmm2
movsd  %xmm2,(%rdx,%rsi,8)
add    $0x1,%esi
mov    %esi,%eax
jmp    196a <fct_curve+0x82a>
movsd  0x8(%rsp),%xmm0
movsd  %xmm0,-0x8(%r12,%rsi,8)
movsd  (%rsp),%xmm1
movsd  %xmm1,-0x8(%r15,%rsi,8)
movsd  0x18(%rsp),%xmm2
movsd  %xmm2,-0x8(%rdx,%rsi,8)
movsd  %xmm0,(%rbx)
movsd  %xmm1,0x0(%rbp)
movsd  %xmm2,(%r14)
add    $0x88,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define i32 @fct_curve(i32 %0, i32 %1, double %2, double* %3, double* %4, double* %5, double %6, double* %7, double* %8, double* %9, i32 %10) {
%12 = alloca i32
%13 = alloca i32
%14 = alloca i32
%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 i32
%24 = alloca i32
%25 = alloca double
%26 = alloca double
%27 = alloca double
%28 = alloca double
%29 = alloca double
%30 = alloca double
%31 = alloca double
%32 = alloca double
%33 = alloca double
%34 = alloca double
%35 = alloca double
%36 = alloca i32
store i32 %0, i32* %13
store i32 %1, i32* %14
store double %2, double* %15
store double* %3, double** %16
store double* %4, double** %17
store double* %5, double** %18
store double %6, double* %19
store double* %7, double** %20
store double* %8, double** %21
store double* %9, double** %22
store i32 %10, i32* %23
%37 = load i32, i32* %13
%38 = icmp eq i32 %37, 3
br i1 %38, label %39, label %52
39: ; preds = %11
%40 = load double, double* %15
%41 = fdiv double %40, 1.000000e+00
%42 = call double @llvm.fabs.f64(double %41)
%43 = fcmp olt double %42, 0x3D719799812DEA11
br i1 %43, label %44, label %45
44: ; preds = %39
store i32 0, i32* %12
br label %510
45: ; preds = %39
%46 = load double, double* %15
%47 = call double @llvm.fabs.f64(double %46)
%48 = fcmp olt double %47, 0x3D719799812DEA11
br i1 %48, label %49, label %50
49: ; preds = %45
store i32 0, i32* %12
br label %510
50: ; preds = %45
br label %51
51: ; preds = %50
br label %52
52: ; preds = %51, %11
%53 = load i32, i32* %13
switch i32 %53, label %502 [
i32 1, label %54
i32 2, label %205
i32 3, label %355
]
54: ; preds = %52
%55 = load double*, double** %16
%56 = load double, double* %55
%57 = load double*, double** %18
%58 = load double, double* %57
%59 = call double @sin(double %58)
%60 = call double @llvm.fmuladd.f64(double 1.000000e+00, double %59, double %56)
store double %60, double* %31
%61 = load double*, double** %17
%62 = load double, double* %61
%63 = load double*, double** %18
%64 = load double, double* %63
%65 = call double @cos(double %64)
%66 = call double @llvm.fmuladd.f64(double -1.000000e+00, double %65, double %62)
store double %66, double* %32
%67 = load double*, double** %18
%68 = load double, double* %67
%69 = fadd double %68, 0x3FF921FB544486E0
store double %69, double* %25
%70 = load i32, i32* %14
%71 = icmp eq i32 %70, 1
br i1 %71, label %72, label %76
72: ; preds = %54
%73 = load double, double* %25
%74 = load double, double* %15
%75 = fsub double %73, %74
store double %75, double* %26
br label %80
76: ; preds = %54
%77 = load double, double* %25
%78 = load double, double* %15
%79 = fadd double %77, %78
store double %79, double* %26
br label %80
80: ; preds = %76, %72
%81 = load double, double* %31
%82 = load double, double* %26
%83 = call double @cos(double %82)
%84 = call double @llvm.fmuladd.f64(double 1.000000e+00, double %83, double %81)
store double %84, double* %33
%85 = load double, double* %32
%86 = load double, double* %26
%87 = call double @sin(double %86)
%88 = call double @llvm.fmuladd.f64(double 1.000000e+00, double %87, double %85)
store double %88, double* %34
%89 = load double*, double** %18
%90 = load double, double* %89
%91 = load i32, i32* %14
%92 = sitofp i32 %91 to double
%93 = load double, double* %15
%94 = fneg double %92
%95 = call double @llvm.fmuladd.f64(double %94, double %93, double %90)
store double %95, double* %35
%96 = load double, double* %15
%97 = load double, double* %19
%98 = fdiv double %96, %97
%99 = fptosi double %98 to i32
store i32 %99, i32* %36
%100 = load double, double* %15
%101 = load i32, i32* %36
%102 = sitofp i32 %101 to double
%103 = load double, double* %19
%104 = fneg double %102
%105 = call double @llvm.fmuladd.f64(double %104, double %103, double %100)
store double %105, double* %30
%106 = load i32, i32* %36
%107 = load i32, i32* %23
%108 = add nsw i32 %106, %107
store i32 %108, i32* %36
%109 = load i32, i32* %14
%110 = icmp eq i32 %109, -1
br i1 %110, label %111, label %114
111: ; preds = %80
%112 = load double, double* %19
%113 = fneg double %112
store double %113, double* %19
br label %114
114: ; preds = %111, %80
store double 0.000000e+00, double* %29
%115 = load i32, i32* %23
store i32 %115, i32* %24
br label %116
116: ; preds = %153, %114
%117 = load i32, i32* %24
%118 = load i32, i32* %36
%119 = icmp slt i32 %117, %118
br i1 %119, label %120, label %156
120: ; preds = %116
%121 = load double, double* %25
%122 = load double, double* %19
%123 = fsub double %121, %122
store double %123, double* %25
%124 = load double, double* %31
%125 = load double, double* %25
%126 = call double @cos(double %125)
%127 = call double @llvm.fmuladd.f64(double 1.000000e+00, double %126, double %124)
%128 = load double*, double** %20
%129 = load i32, i32* %24
%130 = sext i32 %129 to i64
%131 = getelementptr inbounds double, double* %128, i64 %130
store double %127, double* %131
%132 = load double, double* %32
%133 = load double, double* %25
%134 = call double @sin(double %133)
%135 = call double @llvm.fmuladd.f64(double 1.000000e+00, double %134, double %132)
%136 = load double*, double** %21
%137 = load i32, i32* %24
%138 = sext i32 %137 to i64
%139 = getelementptr inbounds double, double* %136, i64 %138
store double %135, double* %139
%140 = load double, double* %29
%141 = load double, double* %19
%142 = fsub double %140, %141
store double %142, double* %29
%143 = load double*, double** %18
%144 = load double, double* %143
%145 = load double, double* %29
%146 = fadd double %144, %145
%147 = call i32 (double, ...) bitcast (i32 (...)* @mod2pi to i32 (double, ...)*)(double %146)
%148 = sitofp i32 %147 to double
%149 = load double*, double** %22
%150 = load i32, i32* %24
%151 = sext i32 %150 to i64
%152 = getelementptr inbounds double, double* %149, i64 %151
store double %148, double* %152
br label %153
153: ; preds = %120
%154 = load i32, i32* %24
%155 = add nsw i32 %154, 1
store i32 %155, i32* %24
br label %116
156: ; preds = %116
%157 = load i32, i32* %36
store i32 %157, i32* %23
%158 = load double, double* %30
%159 = load double, double* %19
%160 = call double @llvm.fabs.f64(double %159)
%161 = fdiv double %160, 5.000000e+00
%162 = fcmp ogt double %158, %161
br i1 %162, label %163, label %183
163: ; preds = %156
%164 = load double, double* %33
%165 = load double*, double** %20
%166 = load i32, i32* %36
%167 = sext i32 %166 to i64
%168 = getelementptr inbounds double, double* %165, i64 %167
store double %164, double* %168
%169 = load double, double* %34
%170 = load double*, double** %21
%171 = load i32, i32* %36
%172 = sext i32 %171 to i64
%173 = getelementptr inbounds double, double* %170, i64 %172
store double %169, double* %173
%174 = load double, double* %35
%175 = call i32 (double, ...) bitcast (i32 (...)* @mod2pi to i32 (double, ...)*)(double %174)
%176 = sitofp i32 %175 to double
%177 = load double*, double** %22
%178 = load i32, i32* %36
%179 = sext i32 %178 to i64
%180 = getelementptr inbounds double, double* %177, i64 %179
store double %176, double* %180
%181 = load i32, i32* %23
%182 = add nsw i32 %181, 1
store i32 %182, i32* %23
br label %204
183: ; preds = %156
%184 = load double, double* %33
%185 = load double*, double** %20
%186 = load i32, i32* %36
%187 = sext i32 %186 to i64
%188 = getelementptr inbounds double, double* %185, i64 %187
%189 = getelementptr inbounds double, double* %188, i64 -1
store double %184, double* %189
%190 = load double, double* %34
%191 = load double*, double** %21
%192 = load i32, i32* %36
%193 = sext i32 %192 to i64
%194 = getelementptr inbounds double, double* %191, i64 %193
%195 = getelementptr inbounds double, double* %194, i64 -1
store double %190, double* %195
%196 = load double, double* %35
%197 = call i32 (double, ...) bitcast (i32 (...)* @mod2pi to i32 (double, ...)*)(double %196)
%198 = sitofp i32 %197 to double
%199 = load double*, double** %22
%200 = load i32, i32* %36
%201 = sext i32 %200 to i64
%202 = getelementptr inbounds double, double* %199, i64 %201
%203 = getelementptr inbounds double, double* %202, i64 -1
store double %198, double* %203
br label %204
204: ; preds = %183, %163
br label %502
205: ; preds = %52
%206 = load double*, double** %16
%207 = load double, double* %206
%208 = load double*, double** %18
%209 = load double, double* %208
%210 = call double @sin(double %209)
%211 = call double @llvm.fmuladd.f64(double -1.000000e+00, double %210, double %207)
store double %211, double* %31
%212 = load double*, double** %17
%213 = load double, double* %212
%214 = load double*, double** %18
%215 = load double, double* %214
%216 = call double @cos(double %215)
%217 = call double @llvm.fmuladd.f64(double 1.000000e+00, double %216, double %213)
store double %217, double* %32
%218 = load double*, double** %18
%219 = load double, double* %218
%220 = fsub double %219, 0x3FF921FB544486E0
store double %220, double* %25
%221 = load i32, i32* %14
%222 = icmp eq i32 %221, 1
br i1 %222, label %223, label %227
223: ; preds = %205
%224 = load double, double* %25
%225 = load double, double* %15
%226 = fadd double %224, %225
store double %226, double* %26
br label %231
227: ; preds = %205
%228 = load double, double* %25
%229 = load double, double* %15
%230 = fsub double %228, %229
store double %230, double* %26
br label %231
231: ; preds = %227, %223
%232 = load double, double* %31
%233 = load double, double* %26
%234 = call double @cos(double %233)
%235 = call double @llvm.fmuladd.f64(double 1.000000e+00, double %234, double %232)
store double %235, double* %33
%236 = load double, double* %32
%237 = load double, double* %26
%238 = call double @sin(double %237)
%239 = call double @llvm.fmuladd.f64(double 1.000000e+00, double %238, double %236)
store double %239, double* %34
%240 = load double*, double** %18
%241 = load double, double* %240
%242 = load i32, i32* %14
%243 = sitofp i32 %242 to double
%244 = load double, double* %15
%245 = call double @llvm.fmuladd.f64(double %243, double %244, double %241)
store double %245, double* %35
%246 = load double, double* %15
%247 = load double, double* %19
%248 = fdiv double %246, %247
%249 = fptosi double %248 to i32
store i32 %249, i32* %36
%250 = load double, double* %15
%251 = load i32, i32* %36
%252 = sitofp i32 %251 to double
%253 = load double, double* %19
%254 = fneg double %252
%255 = call double @llvm.fmuladd.f64(double %254, double %253, double %250)
store double %255, double* %30
%256 = load i32, i32* %36
%257 = load i32, i32* %23
%258 = add nsw i32 %256, %257
store i32 %258, i32* %36
%259 = load i32, i32* %14
%260 = icmp eq i32 %259, -1
br i1 %260, label %261, label %264
261: ; preds = %231
%262 = load double, double* %19
%263 = fneg double %262
store double %263, double* %19
br label %264
264: ; preds = %261, %231
store double 0.000000e+00, double* %29
%265 = load i32, i32* %23
store i32 %265, i32* %24
br label %266
266: ; preds = %303, %264
%267 = load i32, i32* %24
%268 = load i32, i32* %36
%269 = icmp slt i32 %267, %268
br i1 %269, label %270, label %306
270: ; preds = %266
%271 = load double, double* %25
%272 = load double, double* %19
%273 = fadd double %271, %272
store double %273, double* %25
%274 = load double, double* %31
%275 = load double, double* %25
%276 = call double @cos(double %275)
%277 = call double @llvm.fmuladd.f64(double 1.000000e+00, double %276, double %274)
%278 = load double*, double** %20
%279 = load i32, i32* %24
%280 = sext i32 %279 to i64
%281 = getelementptr inbounds double, double* %278, i64 %280
store double %277, double* %281
%282 = load double, double* %32
%283 = load double, double* %25
%284 = call double @sin(double %283)
%285 = call double @llvm.fmuladd.f64(double 1.000000e+00, double %284, double %282)
%286 = load double*, double** %21
%287 = load i32, i32* %24
%288 = sext i32 %287 to i64
%289 = getelementptr inbounds double, double* %286, i64 %288
store double %285, double* %289
%290 = load double, double* %29
%291 = load double, double* %19
%292 = fadd double %290, %291
store double %292, double* %29
%293 = load double*, double** %18
%294 = load double, double* %293
%295 = load double, double* %29
%296 = fadd double %294, %295
%297 = call i32 (double, ...) bitcast (i32 (...)* @mod2pi to i32 (double, ...)*)(double %296)
%298 = sitofp i32 %297 to double
%299 = load double*, double** %22
%300 = load i32, i32* %24
%301 = sext i32 %300 to i64
%302 = getelementptr inbounds double, double* %299, i64 %301
store double %298, double* %302
br label %303
303: ; preds = %270
%304 = load i32, i32* %24
%305 = add nsw i32 %304, 1
store i32 %305, i32* %24
br label %266
306: ; preds = %266
%307 = load i32, i32* %36
store i32 %307, i32* %23
%308 = load double, double* %30
%309 = load double, double* %19
%310 = call double @llvm.fabs.f64(double %309)
%311 = fdiv double %310, 5.000000e+00
%312 = fcmp ogt double %308, %311
br i1 %312, label %313, label %333
313: ; preds = %306
%314 = load double, double* %33
%315 = load double*, double** %20
%316 = load i32, i32* %36
%317 = sext i32 %316 to i64
%318 = getelementptr inbounds double, double* %315, i64 %317
store double %314, double* %318
%319 = load double, double* %34
%320 = load double*, double** %21
%321 = load i32, i32* %36
%322 = sext i32 %321 to i64
%323 = getelementptr inbounds double, double* %320, i64 %322
store double %319, double* %323
%324 = load double, double* %35
%325 = call i32 (double, ...) bitcast (i32 (...)* @mod2pi to i32 (double, ...)*)(double %324)
%326 = sitofp i32 %325 to double
%327 = load double*, double** %22
%328 = load i32, i32* %36
%329 = sext i32 %328 to i64
%330 = getelementptr inbounds double, double* %327, i64 %329
store double %326, double* %330
%331 = load i32, i32* %23
%332 = add nsw i32 %331, 1
store i32 %332, i32* %23
br label %354
333: ; preds = %306
%334 = load double, double* %33
%335 = load double*, double** %20
%336 = load i32, i32* %36
%337 = sext i32 %336 to i64
%338 = getelementptr inbounds double, double* %335, i64 %337
%339 = getelementptr inbounds double, double* %338, i64 -1
store double %334, double* %339
%340 = load double, double* %34
%341 = load double*, double** %21
%342 = load i32, i32* %36
%343 = sext i32 %342 to i64
%344 = getelementptr inbounds double, double* %341, i64 %343
%345 = getelementptr inbounds double, double* %344, i64 -1
store double %340, double* %345
%346 = load double, double* %35
%347 = call i32 (double, ...) bitcast (i32 (...)* @mod2pi to i32 (double, ...)*)(double %346)
%348 = sitofp i32 %347 to double
%349 = load double*, double** %22
%350 = load i32, i32* %36
%351 = sext i32 %350 to i64
%352 = getelementptr inbounds double, double* %349, i64 %351
%353 = getelementptr inbounds double, double* %352, i64 -1
store double %348, double* %353
br label %354
354: ; preds = %333, %313
br label %502
355: ; preds = %52
%356 = load double*, double** %16
%357 = load double, double* %356
%358 = load i32, i32* %14
%359 = sitofp i32 %358 to double
%360 = load double, double* %15
%361 = fmul double %359, %360
%362 = load double*, double** %18
%363 = load double, double* %362
%364 = call double @cos(double %363)
%365 = call double @llvm.fmuladd.f64(double %361, double %364, double %357)
store double %365, double* %33
%366 = load double*, double** %17
%367 = load double, double* %366
%368 = load i32, i32* %14
%369 = sitofp i32 %368 to double
%370 = load double, double* %15
%371 = fmul double %369, %370
%372 = load double*, double** %18
%373 = load double, double* %372
%374 = call double @sin(double %373)
%375 = call double @llvm.fmuladd.f64(double %371, double %374, double %367)
store double %375, double* %34
%376 = load double*, double** %18
%377 = load double, double* %376
%378 = call i32 (double, ...) bitcast (i32 (...)* @mod2pi to i32 (double, ...)*)(double %377)
%379 = sitofp i32 %378 to double
%380 = load double*, double** %18
store double %379, double* %380
%381 = load double*, double** %18
%382 = load double, double* %381
store double %382, double* %35
%383 = load double, double* %33
%384 = load double*, double** %16
%385 = load double, double* %384
%386 = fsub double %383, %385
%387 = load double, double* %33
%388 = load double*, double** %16
%389 = load double, double* %388
%390 = fsub double %387, %389
%391 = load double, double* %34
%392 = load double*, double** %17
%393 = load double, double* %392
%394 = fsub double %391, %393
%395 = load double, double* %34
%396 = load double*, double** %17
%397 = load double, double* %396
%398 = fsub double %395, %397
%399 = fmul double %394, %398
%400 = call double @llvm.fmuladd.f64(double %386, double %390, double %399)
%401 = call double @sqrt(double %400)
store double %401, double* %25
%402 = load double, double* %25
%403 = fdiv double %402, 1.200000e+00
%404 = fptosi double %403 to i32
store i32 %404, i32* %24
%405 = load double, double* %25
%406 = load i32, i32* %24
%407 = sitofp i32 %406 to double
%408 = fneg double %407
%409 = call double @llvm.fmuladd.f64(double %408, double 1.200000e+00, double %405)
store double %409, double* %30
%410 = load i32, i32* %23
%411 = load i32, i32* %24
%412 = add nsw i32 %410, %411
store i32 %412, i32* %36
store double 1.200000e+00, double* %28
%413 = load i32, i32* %14
%414 = sitofp i32 %413 to double
%415 = load double*, double** %18
%416 = load double, double* %415
%417 = call double @cos(double %416)
%418 = fmul double %414, %417
store double %418, double* %25
%419 = load i32, i32* %14
%420 = sitofp i32 %419 to double
%421 = load double*, double** %18
%422 = load double, double* %421
%423 = call double @sin(double %422)
%424 = fmul double %420, %423
store double %424, double* %26
%425 = load i32, i32* %23
store i32 %425, i32* %24
br label %426
426: ; preds = %457, %355
%427 = load i32, i32* %24
%428 = load i32, i32* %36
%429 = icmp slt i32 %427, %428
br i1 %429, label %430, label %460
430: ; preds = %426
%431 = load double*, double** %16
%432 = load double, double* %431
%433 = load double, double* %25
%434 = load double, double* %28
%435 = call double @llvm.fmuladd.f64(double %433, double %434, double %432)
%436 = load double*, double** %20
%437 = load i32, i32* %24
%438 = sext i32 %437 to i64
%439 = getelementptr inbounds double, double* %436, i64 %438
store double %435, double* %439
%440 = load double*, double** %17
%441 = load double, double* %440
%442 = load double, double* %26
%443 = load double, double* %28
%444 = call double @llvm.fmuladd.f64(double %442, double %443, double %441)
%445 = load double*, double** %21
%446 = load i32, i32* %24
%447 = sext i32 %446 to i64
%448 = getelementptr inbounds double, double* %445, i64 %447
store double %444, double* %448
%449 = load double*, double** %18
%450 = load double, double* %449
%451 = load double*, double** %22
%452 = load i32, i32* %24
%453 = sext i32 %452 to i64
%454 = getelementptr inbounds double, double* %451, i64 %453
store double %450, double* %454
%455 = load double, double* %28
%456 = fadd double %455, 1.200000e+00
store double %456, double* %28
br label %457
457: ; preds = %430
%458 = load i32, i32* %24
%459 = add nsw i32 %458, 1
store i32 %459, i32* %24
br label %426
460: ; preds = %426
%461 = load double, double* %30
%462 = fcmp ogt double %461, 4.000000e-01
br i1 %462, label %463, label %481
463: ; preds = %460
%464 = load double, double* %33
%465 = load double*, double** %20
%466 = load i32, i32* %36
%467 = sext i32 %466 to i64
%468 = getelementptr inbounds double, double* %465, i64 %467
store double %464, double* %468
%469 = load double, double* %34
%470 = load double*, double** %21
%471 = load i32, i32* %36
%472 = sext i32 %471 to i64
%473 = getelementptr inbounds double, double* %470, i64 %472
store double %469, double* %473
%474 = load double, double* %35
%475 = load double*, double** %22
%476 = load i32, i32* %36
%477 = sext i32 %476 to i64
%478 = getelementptr inbounds double, double* %475, i64 %477
store double %474, double* %478
%479 = load i32, i32* %36
%480 = add nsw i32 %479, 1
store i32 %480, i32* %23
br label %501
481: ; preds = %460
%482 = load double, double* %33
%483 = load double*, double** %20
%484 = load i32, i32* %36
%485 = sext i32 %484 to i64
%486 = getelementptr inbounds double, double* %483, i64 %485
%487 = getelementptr inbounds double, double* %486, i64 -1
store double %482, double* %487
%488 = load double, double* %34
%489 = load double*, double** %21
%490 = load i32, i32* %36
%491 = sext i32 %490 to i64
%492 = getelementptr inbounds double, double* %489, i64 %491
%493 = getelementptr inbounds double, double* %492, i64 -1
store double %488, double* %493
%494 = load double, double* %35
%495 = load double*, double** %22
%496 = load i32, i32* %36
%497 = sext i32 %496 to i64
%498 = getelementptr inbounds double, double* %495, i64 %497
%499 = getelementptr inbounds double, double* %498, i64 -1
store double %494, double* %499
%500 = load i32, i32* %36
store i32 %500, i32* %23
br label %501
501: ; preds = %481, %463
br label %502
502: ; preds = %501, %52, %354, %204
%503 = load double, double* %33
%504 = load double*, double** %16
store double %503, double* %504
%505 = load double, double* %34
%506 = load double*, double** %17
store double %505, double* %506
%507 = load double, double* %35
%508 = load double*, double** %18
store double %507, double* %508
%509 = load i32, i32* %23
store i32 %509, i32* %12
br label %510
510: ; preds = %502, %49, %44
%511 = load i32, i32* %12
ret i32 %511
}

LLVM IR (-O2):
define i32 @fct_curve(i32 %0, i32 %1, double %2, double* nocapture %3, double* nocapture %4, double* nocapture %5, double %6, double* nocapture writeonly %7, double* nocapture writeonly %8, double* nocapture writeonly %9, i32 %10) {
switch i32 %0, label %229 [
i32 3, label %12
i32 1, label %15
i32 2, label %90
]
12: ; preds = %11
%13 = tail call double @llvm.fabs.f64(double %2)
%14 = fcmp olt double %13, 0x3D719799812DEA11
br i1 %14, label %234, label %164
15: ; preds = %11
%16 = load double, double* %3
%17 = load double, double* %5
%18 = tail call double @sin(double %17)
%19 = fadd double %16, %18
%20 = load double, double* %4
%21 = load double, double* %5
%22 = tail call double @cos(double %21)
%23 = tail call double @llvm.fmuladd.f64(double %22, double -1.000000e+00, double %20)
%24 = load double, double* %5
%25 = fadd double %24, 0x3FF921FB544486E0
%26 = icmp eq i32 %1, 1
%27 = fneg double %2
%28 = select i1 %26, double %27, double %2
%29 = fadd double %28, %25
%30 = tail call double @cos(double %29)
%31 = fadd double %19, %30
%32 = tail call double @sin(double %29)
%33 = fadd double %23, %32
%34 = load double, double* %5
%35 = sitofp i32 %1 to double
%36 = fneg double %35
%37 = tail call double @llvm.fmuladd.f64(double %36, double %2, double %34)
%38 = fdiv double %2, %6
%39 = fptosi double %38 to i32
%40 = sitofp i32 %39 to double
%41 = fneg double %40
%42 = tail call double @llvm.fmuladd.f64(double %41, double %6, double %2)
%43 = add nsw i32 %39, %10
%44 = icmp eq i32 %1, -1
%45 = fneg double %6
%46 = select i1 %44, double %45, double %6
%47 = icmp sgt i32 %39, 0
br i1 %47, label %48, label %70
48: ; preds = %15
%49 = sext i32 %10 to i64
%50 = sext i32 %43 to i64
br label %51
51: ; preds = %48, %51
%52 = phi i64 [ %49, %48 ], [ %68, %51 ]
%53 = phi double [ 0.000000e+00, %48 ], [ %62, %51 ]
%54 = phi double [ %25, %48 ], [ %55, %51 ]
%55 = fsub double %54, %46
%56 = tail call double @cos(double %55)
%57 = fadd double %19, %56
%58 = getelementptr inbounds double, double* %7, i64 %52
store double %57, double* %58
%59 = tail call double @sin(double %55)
%60 = fadd double %23, %59
%61 = getelementptr inbounds double, double* %8, i64 %52
store double %60, double* %61
%62 = fsub double %53, %46
%63 = load double, double* %5
%64 = fadd double %62, %63
%65 = tail call i32 (double, ...) bitcast (i32 (...)* @mod2pi to i32 (double, ...)*)(double %64)
%66 = sitofp i32 %65 to double
%67 = getelementptr inbounds double, double* %9, i64 %52
store double %66, double* %67
%68 = add nsw i64 %52, 1
%69 = icmp slt i64 %68, %50
br i1 %69, label %51, label %70
70: ; preds = %51, %15
%71 = tail call double @llvm.fabs.f64(double %6)
%72 = fdiv double %71, 5.000000e+00
%73 = fcmp ogt double %42, %72
%74 = sext i32 %43 to i64
%75 = getelementptr inbounds double, double* %7, i64 %74
br i1 %73, label %76, label %82
76: ; preds = %70
store double %31, double* %75
%77 = getelementptr inbounds double, double* %8, i64 %74
store double %33, double* %77
%78 = tail call i32 (double, ...) bitcast (i32 (...)* @mod2pi to i32 (double, ...)*)(double %37)
%79 = sitofp i32 %78 to double
%80 = getelementptr inbounds double, double* %9, i64 %74
store double %79, double* %80
%81 = add nsw i32 %43, 1
br label %229
82: ; preds = %70
%83 = getelementptr inbounds double, double* %75, i64 -1
store double %31, double* %83
%84 = getelementptr inbounds double, double* %8, i64 %74
%85 = getelementptr inbounds double, double* %84, i64 -1
store double %33, double* %85
%86 = tail call i32 (double, ...) bitcast (i32 (...)* @mod2pi to i32 (double, ...)*)(double %37)
%87 = sitofp i32 %86 to double
%88 = getelementptr inbounds double, double* %9, i64 %74
%89 = getelementptr inbounds double, double* %88, i64 -1
store double %87, double* %89
br label %229
90: ; preds = %11
%91 = load double, double* %3
%92 = load double, double* %5
%93 = tail call double @sin(double %92)
%94 = tail call double @llvm.fmuladd.f64(double %93, double -1.000000e+00, double %91)
%95 = load double, double* %4
%96 = load double, double* %5
%97 = tail call double @cos(double %96)
%98 = fadd double %95, %97
%99 = load double, double* %5
%100 = fadd double %99, 0xBFF921FB544486E0
%101 = icmp eq i32 %1, 1
%102 = fneg double %2
%103 = select i1 %101, double %2, double %102
%104 = fadd double %103, %100
%105 = tail call double @cos(double %104)
%106 = fadd double %94, %105
%107 = tail call double @sin(double %104)
%108 = fadd double %98, %107
%109 = load double, double* %5
%110 = sitofp i32 %1 to double
%111 = tail call double @llvm.fmuladd.f64(double %110, double %2, double %109)
%112 = fdiv double %2, %6
%113 = fptosi double %112 to i32
%114 = sitofp i32 %113 to double
%115 = fneg double %114
%116 = tail call double @llvm.fmuladd.f64(double %115, double %6, double %2)
%117 = add nsw i32 %113, %10
%118 = icmp eq i32 %1, -1
%119 = fneg double %6
%120 = select i1 %118, double %119, double %6
%121 = icmp sgt i32 %113, 0
br i1 %121, label %122, label %144
122: ; preds = %90
%123 = sext i32 %10 to i64
%124 = sext i32 %117 to i64
br label %125
125: ; preds = %122, %125
%126 = phi i64 [ %123, %122 ], [ %142, %125 ]
%127 = phi double [ 0.000000e+00, %122 ], [ %136, %125 ]
%128 = phi double [ %100, %122 ], [ %129, %125 ]
%129 = fadd double %120, %128
%130 = tail call double @cos(double %129)
%131 = fadd double %94, %130
%132 = getelementptr inbounds double, double* %7, i64 %126
store double %131, double* %132
%133 = tail call double @sin(double %129)
%134 = fadd double %98, %133
%135 = getelementptr inbounds double, double* %8, i64 %126
store double %134, double* %135
%136 = fadd double %120, %127
%137 = load double, double* %5
%138 = fadd double %136, %137
%139 = tail call i32 (double, ...) bitcast (i32 (...)* @mod2pi to i32 (double, ...)*)(double %138)
%140 = sitofp i32 %139 to double
%141 = getelementptr inbounds double, double* %9, i64 %126
store double %140, double* %141
%142 = add nsw i64 %126, 1
%143 = icmp slt i64 %142, %124
br i1 %143, label %125, label %144
144: ; preds = %125, %90
%145 = tail call double @llvm.fabs.f64(double %6)
%146 = fdiv double %145, 5.000000e+00
%147 = fcmp ogt double %116, %146
%148 = sext i32 %117 to i64
%149 = getelementptr inbounds double, double* %7, i64 %148
br i1 %147, label %150, label %156
150: ; preds = %144
store double %106, double* %149
%151 = getelementptr inbounds double, double* %8, i64 %148
store double %108, double* %151
%152 = tail call i32 (double, ...) bitcast (i32 (...)* @mod2pi to i32 (double, ...)*)(double %111)
%153 = sitofp i32 %152 to double
%154 = getelementptr inbounds double, double* %9, i64 %148
store double %153, double* %154
%155 = add nsw i32 %117, 1
br label %229
156: ; preds = %144
%157 = getelementptr inbounds double, double* %149, i64 -1
store double %106, double* %157
%158 = getelementptr inbounds double, double* %8, i64 %148
%159 = getelementptr inbounds double, double* %158, i64 -1
store double %108, double* %159
%160 = tail call i32 (double, ...) bitcast (i32 (...)* @mod2pi to i32 (double, ...)*)(double %111)
%161 = sitofp i32 %160 to double
%162 = getelementptr inbounds double, double* %9, i64 %148
%163 = getelementptr inbounds double, double* %162, i64 -1
store double %161, double* %163
br label %229
164: ; preds = %12
%165 = load double, double* %3
%166 = sitofp i32 %1 to double
%167 = fmul double %166, %2
%168 = load double, double* %5
%169 = tail call double @cos(double %168)
%170 = tail call double @llvm.fmuladd.f64(double %167, double %169, double %165)
%171 = load double, double* %4
%172 = load double, double* %5
%173 = tail call double @sin(double %172)
%174 = tail call double @llvm.fmuladd.f64(double %167, double %173, double %171)
%175 = load double, double* %5
%176 = tail call i32 (double, ...) bitcast (i32 (...)* @mod2pi to i32 (double, ...)*)(double %175)
%177 = sitofp i32 %176 to double
store double %177, double* %5
%178 = load double, double* %3
%179 = fsub double %170, %178
%180 = load double, double* %4
%181 = fsub double %174, %180
%182 = fmul double %181, %181
%183 = tail call double @llvm.fmuladd.f64(double %179, double %179, double %182)
%184 = tail call double @sqrt(double %183)
%185 = fdiv double %184, 1.200000e+00
%186 = fptosi double %185 to i32
%187 = sitofp i32 %186 to double
%188 = fneg double %187
%189 = tail call double @llvm.fmuladd.f64(double %188, double 1.200000e+00, double %184)
%190 = add nsw i32 %186, %10
%191 = load double, double* %5
%192 = tail call double @cos(double %191)
%193 = fmul double %192, %166
%194 = load double, double* %5
%195 = tail call double @sin(double %194)
%196 = fmul double %195, %166
%197 = icmp sgt i32 %186, 0
br i1 %197, label %198, label %215
198: ; preds = %164
%199 = sext i32 %10 to i64
%200 = sext i32 %190 to i64
br label %201
201: ; preds = %198, %201
%202 = phi i64 [ %199, %198 ], [ %213, %201 ]
%203 = phi double [ 1.200000e+00, %198 ], [ %212, %201 ]
%204 = load double, double* %3
%205 = tail call double @llvm.fmuladd.f64(double %193, double %203, double %204)
%206 = getelementptr inbounds double, double* %7, i64 %202
store double %205, double* %206
%207 = load double, double* %4
%208 = tail call double @llvm.fmuladd.f64(double %196, double %203, double %207)
%209 = getelementptr inbounds double, double* %8, i64 %202
store double %208, double* %209
%210 = load double, double* %5
%211 = getelementptr inbounds double, double* %9, i64 %202
store double %210, double* %211
%212 = fadd double %203, 1.200000e+00
%213 = add nsw i64 %202, 1
%214 = icmp slt i64 %213, %200
br i1 %214, label %201, label %215
215: ; preds = %201, %164
%216 = fcmp ogt double %189, 4.000000e-01
%217 = sext i32 %190 to i64
%218 = getelementptr inbounds double, double* %7, i64 %217
br i1 %216, label %219, label %223
219: ; preds = %215
store double %170, double* %218
%220 = getelementptr inbounds double, double* %8, i64 %217
store double %174, double* %220
%221 = getelementptr inbounds double, double* %9, i64 %217
store double %177, double* %221
%222 = add nsw i32 %190, 1
br label %229
223: ; preds = %215
%224 = getelementptr inbounds double, double* %218, i64 -1
store double %170, double* %224
%225 = getelementptr inbounds double, double* %8, i64 %217
%226 = getelementptr inbounds double, double* %225, i64 -1
store double %174, double* %226
%227 = getelementptr inbounds double, double* %9, i64 %217
%228 = getelementptr inbounds double, double* %227, i64 -1
store double %177, double* %228
br label %229
229: ; preds = %11, %219, %223, %150, %156, %76, %82
%230 = phi i32 [ %222, %219 ], [ %190, %223 ], [ %155, %150 ], [ %117, %156 ], [ %81, %76 ], [ %43, %82 ], [ %10, %11 ]
%231 = phi double [ %170, %219 ], [ %170, %223 ], [ %106, %150 ], [ %106, %156 ], [ %31, %76 ], [ %31, %82 ], [ undef, %11 ]
%232 = phi double [ %174, %219 ], [ %174, %223 ], [ %108, %150 ], [ %108, %156 ], [ %33, %76 ], [ %33, %82 ], [ undef, %11 ]
%233 = phi double [ %177, %219 ], [ %177, %223 ], [ %111, %150 ], [ %111, %156 ], [ %37, %76 ], [ %37, %82 ], [ undef, %11 ]
store double %231, double* %3
store double %232, double* %4
store double %233, double* %5
br label %234
234: ; preds = %12, %229
%235 = phi i32 [ %230, %229 ], [ 0, %12 ]
ret i32 %235
}