package org.netlib.lapack;
import org.netlib.blas.Dcopy;
import org.netlib.err.Xerbla;
import org.netlib.util.doubleW;
import org.netlib.util.intW;
public final class Dlasda
{
  public static void dlasda(int paramInt1, int paramInt2, int paramInt3, int paramInt4, double[] paramArrayOfDouble1, int paramInt5, double[] paramArrayOfDouble2, int paramInt6, double[] paramArrayOfDouble3, int paramInt7, int paramInt8, double[] paramArrayOfDouble4, int paramInt9, int[] paramArrayOfInt1, int paramInt10, double[] paramArrayOfDouble5, int paramInt11, double[] paramArrayOfDouble6, int paramInt12, double[] paramArrayOfDouble7, int paramInt13, double[] paramArrayOfDouble8, int paramInt14, int[] paramArrayOfInt2, int paramInt15, int[] paramArrayOfInt3, int paramInt16, int paramInt17, int[] paramArrayOfInt4, int paramInt18, double[] paramArrayOfDouble9, int paramInt19, double[] paramArrayOfDouble10, int paramInt20, double[] paramArrayOfDouble11, int paramInt21, double[] paramArrayOfDouble12, int paramInt22, int[] paramArrayOfInt5, int paramInt23, intW paramintW)
  {
    int i = 0;
    int j = 0;
    int k = 0;
    int m = 0;
    int n = 0;
    int i1 = 0;
    int i2 = 0;
    int i3 = 0;
    int i4 = 0;
    int i5 = 0;
    int i6 = 0;
    int i7 = 0;
    int i8 = 0;
    int i9 = 0;
    int i10 = 0;
    int i11 = 0;
    intW localintW1 = new intW(0);
    int i12 = 0;
    int i13 = 0;
    int i14 = 0;
    int i15 = 0;
    int i16 = 0;
    int i17 = 0;
    intW localintW2 = new intW(0);
    int i18 = 0;
    int i19 = 0;
    int i20 = 0;
    int i21 = 0;
    int i22 = 0;
    int i23 = 0;
    int i24 = 0;
    int i25 = 0;
    int i26 = 0;
    int i27 = 0;
    int i28 = 0;
    int i29 = 0;
    doubleW localdoubleW1 = new doubleW(0.0D);
    doubleW localdoubleW2 = new doubleW(0.0D);
    paramintW.val = 0;
    if ((paramInt1 >= 0 ? 0 : 1) == 0) {}
    if (((paramInt1 <= 1 ? 0 : 1) == 0 ? 0 : 1) != 0)
    {
      paramintW.val = -1;
    }
    else if ((paramInt2 >= 3 ? 0 : 1) != 0)
    {
      paramintW.val = -2;
    }
    else if ((paramInt3 >= 0 ? 0 : 1) != 0)
    {
      paramintW.val = -3;
    }
    else
    {
      if ((paramInt4 >= 0 ? 0 : 1) == 0) {}
      if (((paramInt4 <= 1 ? 0 : 1) == 0 ? 0 : 1) != 0) {
        paramintW.val = -4;
      } else if ((paramInt8 >= paramInt3 + paramInt4 ? 0 : 1) != 0) {
        paramintW.val = -8;
      } else if ((paramInt17 >= paramInt3 ? 0 : 1) != 0) {
        paramintW.val = -17;
      }
    }
    if ((paramintW.val == 0 ? 0 : 1) != 0)
    {
      Xerbla.xerbla("DLASDA", -paramintW.val);
      return;
    }
    i10 = paramInt3 + paramInt4;
    if ((paramInt3 > paramInt2 ? 0 : 1) != 0)
    {
      if ((paramInt1 != 0 ? 0 : 1) != 0) {
        Dlasdq.dlasdq("U", paramInt4, paramInt3, 0, 0, 0, paramArrayOfDouble1, paramInt5, paramArrayOfDouble2, paramInt6, paramArrayOfDouble4, paramInt9, paramInt8, paramArrayOfDouble3, paramInt7, paramInt8, paramArrayOfDouble3, paramInt7, paramInt8, paramArrayOfDouble12, paramInt22, paramintW);
      } else {
        Dlasdq.dlasdq("U", paramInt4, paramInt3, i10, paramInt3, 0, paramArrayOfDouble1, paramInt5, paramArrayOfDouble2, paramInt6, paramArrayOfDouble4, paramInt9, paramInt8, paramArrayOfDouble3, paramInt7, paramInt8, paramArrayOfDouble3, paramInt7, paramInt8, paramArrayOfDouble12, paramInt22, paramintW);
      }
      return;
    }
    i2 = 1;
    i13 = i2 + paramInt3;
    i14 = i13 + paramInt3;
    m = i14 + paramInt3;
    i4 = m + paramInt3;
    i11 = 0;
    i21 = 0;
    i24 = paramInt2 + 1;
    i26 = 1;
    i28 = i26 + i10;
    i22 = i28 + i10;
    i23 = i22 + i24 * i24;
    Dlasdt.dlasdt(paramInt3, localintW2, localintW1, paramArrayOfInt5, i2 - 1 + paramInt23, paramArrayOfInt5, i13 - 1 + paramInt23, paramArrayOfInt5, i14 - 1 + paramInt23, paramInt2);
    i12 = (localintW1.val + 1) / 2;
    i = i12;
    int i31;
    for (int i30 = localintW1.val - i12 + 1; i30 > 0; i30--)
    {
      j = i - 1;
      k = paramArrayOfInt5[(i2 + j - 1 + paramInt23)];
      i15 = paramArrayOfInt5[(i13 + j - 1 + paramInt23)];
      i17 = i15 + 1;
      i18 = paramArrayOfInt5[(i14 + j - 1 + paramInt23)];
      i16 = k - i15;
      i19 = k + 1;
      n = m + i16 - 2;
      i27 = i26 + i16 - 1;
      i29 = i28 + i16 - 1;
      i25 = 1;
      if ((paramInt1 != 0 ? 0 : 1) != 0)
      {
        Dlaset.dlaset("A", i17, i17, 0.0D, 1.0D, paramArrayOfDouble12, i22 - 1 + paramInt22, i24);
        Dlasdq.dlasdq("U", i25, i15, i17, i21, i11, paramArrayOfDouble1, i16 - 1 + paramInt5, paramArrayOfDouble2, i16 - 1 + paramInt6, paramArrayOfDouble12, i22 - 1 + paramInt22, i24, paramArrayOfDouble12, i23 - 1 + paramInt22, i15, paramArrayOfDouble12, i23 - 1 + paramInt22, i15, paramArrayOfDouble12, i23 - 1 + paramInt22, paramintW);
        i3 = i22 + i15 * i24;
        Dcopy.dcopy(i17, paramArrayOfDouble12, i22 - 1 + paramInt22, 1, paramArrayOfDouble12, i27 - 1 + paramInt22, 1);
        Dcopy.dcopy(i17, paramArrayOfDouble12, i3 - 1 + paramInt22, 1, paramArrayOfDouble12, i29 - 1 + paramInt22, 1);
      }
      else
      {
        Dlaset.dlaset("A", i15, i15, 0.0D, 1.0D, paramArrayOfDouble3, i16 - 1 + (1 - 1) * paramInt8 + paramInt7, paramInt8);
        Dlaset.dlaset("A", i17, i17, 0.0D, 1.0D, paramArrayOfDouble4, i16 - 1 + (1 - 1) * paramInt8 + paramInt9, paramInt8);
        Dlasdq.dlasdq("U", i25, i15, i17, i15, i11, paramArrayOfDouble1, i16 - 1 + paramInt5, paramArrayOfDouble2, i16 - 1 + paramInt6, paramArrayOfDouble4, i16 - 1 + (1 - 1) * paramInt8 + paramInt9, paramInt8, paramArrayOfDouble3, i16 - 1 + (1 - 1) * paramInt8 + paramInt7, paramInt8, paramArrayOfDouble3, i16 - 1 + (1 - 1) * paramInt8 + paramInt7, paramInt8, paramArrayOfDouble12, i22 - 1 + paramInt22, paramintW);
        Dcopy.dcopy(i17, paramArrayOfDouble4, i16 - 1 + (1 - 1) * paramInt8 + paramInt9, 1, paramArrayOfDouble12, i27 - 1 + paramInt22, 1);
        Dcopy.dcopy(i17, paramArrayOfDouble4, i16 - 1 + (i17 - 1) * paramInt8 + paramInt9, 1, paramArrayOfDouble12, i29 - 1 + paramInt22, 1);
      }
      if ((paramintW.val == 0 ? 0 : 1) != 0) {
        return;
      }
      i5 = 1;
      for (i31 = i15 - 1 + 1; i31 > 0; i31--)
      {
        paramArrayOfInt5[(n + i5 - 1 + paramInt23)] = i5;
        i5 += 1;
      }
      if ((i != localintW1.val ? 0 : 1) != 0) {}
      if (((paramInt4 != 0 ? 0 : 1) != 0 ? 1 : 0) != 0) {
        i25 = 0;
      } else {
        i25 = 1;
      }
      n += i17;
      i27 += i17;
      i29 += i17;
      i20 = i18 + i25;
      if ((paramInt1 != 0 ? 0 : 1) != 0)
      {
        Dlaset.dlaset("A", i20, i20, 0.0D, 1.0D, paramArrayOfDouble12, i22 - 1 + paramInt22, i24);
        Dlasdq.dlasdq("U", i25, i18, i20, i21, i11, paramArrayOfDouble1, i19 - 1 + paramInt5, paramArrayOfDouble2, i19 - 1 + paramInt6, paramArrayOfDouble12, i22 - 1 + paramInt22, i24, paramArrayOfDouble12, i23 - 1 + paramInt22, i18, paramArrayOfDouble12, i23 - 1 + paramInt22, i18, paramArrayOfDouble12, i23 - 1 + paramInt22, paramintW);
        i3 = i22 + (i20 - 1) * i24;
        Dcopy.dcopy(i20, paramArrayOfDouble12, i22 - 1 + paramInt22, 1, paramArrayOfDouble12, i27 - 1 + paramInt22, 1);
        Dcopy.dcopy(i20, paramArrayOfDouble12, i3 - 1 + paramInt22, 1, paramArrayOfDouble12, i29 - 1 + paramInt22, 1);
      }
      else
      {
        Dlaset.dlaset("A", i18, i18, 0.0D, 1.0D, paramArrayOfDouble3, i19 - 1 + (1 - 1) * paramInt8 + paramInt7, paramInt8);
        Dlaset.dlaset("A", i20, i20, 0.0D, 1.0D, paramArrayOfDouble4, i19 - 1 + (1 - 1) * paramInt8 + paramInt9, paramInt8);
        Dlasdq.dlasdq("U", i25, i18, i20, i18, i11, paramArrayOfDouble1, i19 - 1 + paramInt5, paramArrayOfDouble2, i19 - 1 + paramInt6, paramArrayOfDouble4, i19 - 1 + (1 - 1) * paramInt8 + paramInt9, paramInt8, paramArrayOfDouble3, i19 - 1 + (1 - 1) * paramInt8 + paramInt7, paramInt8, paramArrayOfDouble3, i19 - 1 + (1 - 1) * paramInt8 + paramInt7, paramInt8, paramArrayOfDouble12, i22 - 1 + paramInt22, paramintW);
        Dcopy.dcopy(i20, paramArrayOfDouble4, i19 - 1 + (1 - 1) * paramInt8 + paramInt9, 1, paramArrayOfDouble12, i27 - 1 + paramInt22, 1);
        Dcopy.dcopy(i20, paramArrayOfDouble4, i19 - 1 + (i20 - 1) * paramInt8 + paramInt9, 1, paramArrayOfDouble12, i29 - 1 + paramInt22, 1);
      }
      if ((paramintW.val == 0 ? 0 : 1) != 0) {
        return;
      }
      i5 = 1;
      for (i31 = i18 - 1 + 1; i31 > 0; i31--)
      {
        paramArrayOfInt5[(n + i5 - 1 + paramInt23)] = i5;
        i5 += 1;
      }
      i += 1;
    }
    i5 = (int)Math.pow(2, localintW2.val);
    i8 = localintW2.val;
    for (int i30 = (1 - localintW2.val + -1) / -1; i30 > 0; i30--)
    {
      i9 = i8 * 2 - 1;
      if ((i8 != 1 ? 0 : 1) != 0)
      {
        i6 = 1;
        i7 = 1;
      }
      else
      {
        i6 = (int)Math.pow(2, i8 - 1);
        i7 = 2 * i6 - 1;
      }
      i = i6;
      for (i31 = i7 - i6 + 1; i31 > 0; i31--)
      {
        i1 = i - 1;
        k = paramArrayOfInt5[(i2 + i1 - 1 + paramInt23)];
        i15 = paramArrayOfInt5[(i13 + i1 - 1 + paramInt23)];
        i18 = paramArrayOfInt5[(i14 + i1 - 1 + paramInt23)];
        i16 = k - i15;
        i19 = k + 1;


Answer:         if ((i != i7 ? 0 : 1) != 0) {