/* Produced by CVXGEN, 2017-11-20 12:18:49 -0500.  */
/* CVXGEN is Copyright (C) 2006-2017 Jacob Mattingley, jem@cvxgen.com. */
/* The code in this file is Copyright (C) 2006-2017 Jacob Mattingley. */
/* CVXGEN, or solvers produced by CVXGEN, cannot be used for commercial */
/* applications without prior written permission from Jacob Mattingley. */

/* Filename: solver.c. */
/* Description: Main solver file. */
#include "solver.cuh"

CUDA_CALLABLE_MEMBER
double eval_gap(Workspace& work) {
  int i;
  double gap;
  gap = 0;
  for (i = 0; i < 40; i++)
    gap += work.z[i]*work.s[i];
  return gap;
}

CUDA_CALLABLE_MEMBER
void set_defaults(Settings& settings) {
  settings.resid_tol = 1e-6;
  settings.eps = 1e-4;
  settings.max_iters = 25;
  settings.refine_steps = 1;
  settings.s_init = 1;
  settings.z_init = 1;
  settings.debug = 0;
  settings.verbose = 1;
  settings.verbose_refinement = 0;
  settings.better_start = 1;
  settings.kkt_reg = 1e-7;
}

CUDA_CALLABLE_MEMBER
void setup_pointers(Workspace& work, Vars& vars) {
  work.y = work.x + 20;
  work.s = work.x + 21;
  work.z = work.x + 61;
  vars.Weights = work.x + 0;
}

CUDA_CALLABLE_MEMBER
void setup_indexing(Workspace& work, Vars& vars) {
  setup_pointers(work, vars);
}

CUDA_CALLABLE_MEMBER
void set_start(Workspace& work, Settings& settings) {
  int i;
  for (i = 0; i < 20; i++)
    work.x[i] = 0;
  for (i = 0; i < 1; i++)
    work.y[i] = 0;
  for (i = 0; i < 40; i++)
    work.s[i] = (work.h[i] > 0) ? work.h[i] : settings.s_init;
  for (i = 0; i < 40; i++)
    work.z[i] = settings.z_init;
}

CUDA_CALLABLE_MEMBER
double eval_objv(Workspace& work, Params& params) {
  int i;
  double objv;
  /* Borrow space in work.rhs. */
  multbyP(work.rhs, work.x, params);
  objv = 0;
  for (i = 0; i < 20; i++)
    objv += work.x[i]*work.rhs[i];
  objv *= 0.5;
  for (i = 0; i < 20; i++)
    objv += work.q[i]*work.x[i];
  objv += 0;
  return objv;
}

CUDA_CALLABLE_MEMBER
void fillrhs_aff(Workspace& work, Params& params) {
  int i;
  double *r1, *r2, *r3, *r4;
  r1 = work.rhs;
  r2 = work.rhs + 20;
  r3 = work.rhs + 60;
  r4 = work.rhs + 100;
  /* r1 = -A^Ty - G^Tz - Px - q. */
  multbymAT(r1, work.y);
  multbymGT(work.buffer, work.z);
  for (i = 0; i < 20; i++)
    r1[i] += work.buffer[i];
  multbyP(work.buffer, work.x, params);
  for (i = 0; i < 20; i++)
    r1[i] -= work.buffer[i] + work.q[i];
  /* r2 = -z. */
  for (i = 0; i < 40; i++)
    r2[i] = -work.z[i];
  /* r3 = -Gx - s + h. */
  multbymG(r3, work.x);
  for (i = 0; i < 40; i++)
    r3[i] += -work.s[i] + work.h[i];
  /* r4 = -Ax + b. */
  multbymA(r4, work.x);
  for (i = 0; i < 1; i++)
    r4[i] += work.b[i];
}

CUDA_CALLABLE_MEMBER
void fillrhs_cc(Workspace& work) {
  int i;
  double *r2;
  double *ds_aff, *dz_aff;
  double mu;
  double alpha;
  double sigma;
  double smu;
  double minval;
  r2 = work.rhs + 20;
  ds_aff = work.lhs_aff + 20;
  dz_aff = work.lhs_aff + 60;
  mu = 0;
  for (i = 0; i < 40; i++)
    mu += work.s[i]*work.z[i];
  /* Don't finish calculating mu quite yet. */
  /* Find min(min(ds./s), min(dz./z)). */
  minval = 0;
  for (i = 0; i < 40; i++)
    if (ds_aff[i] < minval*work.s[i])
      minval = ds_aff[i]/work.s[i];
  for (i = 0; i < 40; i++)
    if (dz_aff[i] < minval*work.z[i])
      minval = dz_aff[i]/work.z[i];
  /* Find alpha. */
  if (-1 < minval)
      alpha = 1;
  else
      alpha = -1/minval;
  sigma = 0;
  for (i = 0; i < 40; i++)
    sigma += (work.s[i] + alpha*ds_aff[i])*
      (work.z[i] + alpha*dz_aff[i]);
  sigma /= mu;
  sigma = sigma*sigma*sigma;
  /* Finish calculating mu now. */
  mu *= 0.025;
  smu = sigma*mu;
  /* Fill-in the rhs. */
  for (i = 0; i < 20; i++)
    work.rhs[i] = 0;
  for (i = 60; i < 101; i++)
    work.rhs[i] = 0;
  for (i = 0; i < 40; i++)
    r2[i] = work.s_inv[i]*(smu - ds_aff[i]*dz_aff[i]);
}

CUDA_CALLABLE_MEMBER
void refine(double *target, double *var, Workspace& work, Settings& settings) {
  int i, j;
  double *residual = work.buffer;
  double norm2;
  double *new_var = work.buffer2;
  for (j = 0; j < settings.refine_steps; j++) {
    norm2 = 0;
    matrix_multiply(residual, var, work, settings);
    for (i = 0; i < 101; i++) {
      residual[i] = residual[i] - target[i];
      norm2 += residual[i]*residual[i];
    }
#ifndef ZERO_LIBRARY_MODE
    if (settings.verbose_refinement) {
      if (j == 0)
        printf("Initial residual before refinement has norm squared %.6g.\n", norm2);
      else
        printf("After refinement we get squared norm %.6g.\n", norm2);
    }
#endif
    /* Solve to find new_var = KKT \ (target - A*var). */
    ldl_solve(residual, new_var, work, settings);
    /* Update var += new_var, or var += KKT \ (target - A*var). */
    for (i = 0; i < 101; i++) {
      var[i] -= new_var[i];
    }
  }
#ifndef ZERO_LIBRARY_MODE
  if (settings.verbose_refinement) {
    /* Check the residual once more, but only if we're reporting it, since */
    /* it's expensive. */
    norm2 = 0;
    matrix_multiply(residual, var, work, settings);
    for (i = 0; i < 101; i++) {
      residual[i] = residual[i] - target[i];
      norm2 += residual[i]*residual[i];
    }
    if (j == 0)
      printf("Initial residual before refinement has norm squared %.6g.\n", norm2);
    else
      printf("After refinement we get squared norm %.6g.\n", norm2);
  }
#endif
}

CUDA_CALLABLE_MEMBER
double calc_ineq_resid_squared(Workspace& work) {
  /* Calculates the norm ||-Gx - s + h||. */
  double norm2_squared;
  int i;
  /* Find -Gx. */
  multbymG(work.buffer, work.x);
  /* Add -s + h. */
  for (i = 0; i < 40; i++)
    work.buffer[i] += -work.s[i] + work.h[i];
  /* Now find the squared norm. */
  norm2_squared = 0;
  for (i = 0; i < 40; i++)
    norm2_squared += work.buffer[i]*work.buffer[i];
  return norm2_squared;
}

CUDA_CALLABLE_MEMBER
double calc_eq_resid_squared(Workspace& work) {
  /* Calculates the norm ||-Ax + b||. */
  double norm2_squared;
  int i;
  /* Find -Ax. */
  multbymA(work.buffer, work.x);
  /* Add +b. */
  for (i = 0; i < 1; i++)
    work.buffer[i] += work.b[i];
  /* Now find the squared norm. */
  norm2_squared = 0;
  for (i = 0; i < 1; i++)
    norm2_squared += work.buffer[i]*work.buffer[i];
  return norm2_squared;
}

CUDA_CALLABLE_MEMBER
void better_start(Workspace& work, Settings& settings, Params& params) {
  /* Calculates a better starting point, using a similar approach to CVXOPT. */
  /* Not yet speed optimized. */
  int i;
  double *x, *s, *z, *y;
  double alpha;
  work.block_33[0] = -1;
  /* Make sure sinvz is 1 to make hijacked KKT system ok. */
  for (i = 0; i < 40; i++)
    work.s_inv_z[i] = 1;
  fill_KKT(work, params);
  ldl_factor(work, settings);
  fillrhs_start(work);
  /* Borrow work.lhs_aff for the solution. */
  ldl_solve(work.rhs, work.lhs_aff, work, settings);
  /* Don't do any refinement for now. Precision doesn't matter too much. */
  x = work.lhs_aff;
  s = work.lhs_aff + 20;
  z = work.lhs_aff + 60;
  y = work.lhs_aff + 100;
  /* Just set x and y as is. */
  for (i = 0; i < 20; i++)
    work.x[i] = x[i];
  for (i = 0; i < 1; i++)
    work.y[i] = y[i];
  /* Now complete the initialization. Start with s. */
  /* Must have alpha > max(z). */
  alpha = -1e99;
  for (i = 0; i < 40; i++)
    if (alpha < z[i])
      alpha = z[i];
  if (alpha < 0) {
    for (i = 0; i < 40; i++)
      work.s[i] = -z[i];
  } else {
    alpha += 1;
    for (i = 0; i < 40; i++)
      work.s[i] = -z[i] + alpha;
  }
  /* Now initialize z. */
  /* Now must have alpha > max(-z). */
  alpha = -1e99;
  for (i = 0; i < 40; i++)
    if (alpha < -z[i])
      alpha = -z[i];
  if (alpha < 0) {
    for (i = 0; i < 40; i++)
      work.z[i] = z[i];
  } else {
    alpha += 1;
    for (i = 0; i < 40; i++)
      work.z[i] = z[i] + alpha;
  }
}

CUDA_CALLABLE_MEMBER
void fillrhs_start(Workspace& work) {
  /* Fill rhs with (-q, 0, h, b). */
  int i;
  double *r1, *r2, *r3, *r4;
  r1 = work.rhs;
  r2 = work.rhs + 20;
  r3 = work.rhs + 60;
  r4 = work.rhs + 100;
  for (i = 0; i < 20; i++)
    r1[i] = -work.q[i];
  for (i = 0; i < 40; i++)
    r2[i] = 0;
  for (i = 0; i < 40; i++)
    r3[i] = work.h[i];
  for (i = 0; i < 1; i++)
    r4[i] = work.b[i];
}

CUDA_CALLABLE_MEMBER
long solve(Workspace& work, Settings& settings, Params& params, Vars& vars) {
  int i;
  int iter;
  double *dx, *ds, *dy, *dz;
  double minval;
  double alpha;
  work.converged = 0;
  setup_pointers(work, vars);
  pre_ops();
#ifndef ZERO_LIBRARY_MODE
  if (settings.verbose)
    printf("iter     objv        gap       |Ax-b|    |Gx+s-h|    step\n");
#endif
  fillq(work, params);
  fillh(work);
  fillb(work);
  if (settings.better_start)
    better_start(work, settings, params);
  else
    set_start(work, settings);
  for (iter = 0; iter < settings.max_iters; iter++) {
    for (i = 0; i < 40; i++) {
      work.s_inv[i] = 1.0 / work.s[i];
      work.s_inv_z[i] = work.s_inv[i]*work.z[i];
    }
    work.block_33[0] = 0;
    fill_KKT(work, params);
    ldl_factor(work, settings);
    /* Affine scaling directions. */
    fillrhs_aff(work, params);
    ldl_solve(work.rhs, work.lhs_aff, work, settings);
    refine(work.rhs, work.lhs_aff, work, settings);
    /* Centering plus corrector directions. */
    fillrhs_cc(work);
    ldl_solve(work.rhs, work.lhs_cc, work, settings);
    refine(work.rhs, work.lhs_cc, work, settings);
    /* Add the two together and store in aff. */
    for (i = 0; i < 101; i++)
      work.lhs_aff[i] += work.lhs_cc[i];
    /* Rename aff to reflect its new meaning. */
    dx = work.lhs_aff;
    ds = work.lhs_aff + 20;
    dz = work.lhs_aff + 60;
    dy = work.lhs_aff + 100;
    /* Find min(min(ds./s), min(dz./z)). */
    minval = 0;
    for (i = 0; i < 40; i++)
      if (ds[i] < minval*work.s[i])
        minval = ds[i]/work.s[i];
    for (i = 0; i < 40; i++)
      if (dz[i] < minval*work.z[i])
        minval = dz[i]/work.z[i];
    /* Find alpha. */
    if (-0.99 < minval)
      alpha = 1;
    else
      alpha = -0.99/minval;
    /* Update the primal and dual variables. */
    for (i = 0; i < 20; i++)
      work.x[i] += alpha*dx[i];
    for (i = 0; i < 40; i++)
      work.s[i] += alpha*ds[i];
    for (i = 0; i < 40; i++)
      work.z[i] += alpha*dz[i];
    for (i = 0; i < 1; i++)
      work.y[i] += alpha*dy[i];
    work.gap = eval_gap(work);
    work.eq_resid_squared = calc_eq_resid_squared(work);
    work.ineq_resid_squared = calc_ineq_resid_squared(work);
#ifndef ZERO_LIBRARY_MODE
    if (settings.verbose) {
      work.optval = eval_objv(work, params);
      printf("%3d   %10.3e  %9.2e  %9.2e  %9.2e  % 6.4f\n",
          iter+1, work.optval, work.gap, sqrt(work.eq_resid_squared),
          sqrt(work.ineq_resid_squared), alpha);
    }
#endif
    /* Test termination conditions. Requires optimality, and satisfied */
    /* constraints. */
    if (   (work.gap < settings.eps)
        && (work.eq_resid_squared <= settings.resid_tol*settings.resid_tol)
        && (work.ineq_resid_squared <= settings.resid_tol*settings.resid_tol)
       ) {
      work.converged = 1;
      work.optval = eval_objv(work, params);
      return iter+1;
    }
  }
  return iter;
}

	.file	"tmpxft_002ee4bc_00000000-6_solver.cudafe1.cpp"
	.text
#APP

#NO_APP
	.type	_ZL26__cudaUnregisterBinaryUtilv, @function
_ZL26__cudaUnregisterBinaryUtilv:
.LFB2043:
	.cfi_startproc
	endbr64
	movq	_ZL20__cudaFatCubinHandle(%rip), %rdi
	jmp	__cudaUnregisterFatBinary@PLT
	.cfi_endproc
.LFE2043:
	.size	_ZL26__cudaUnregisterBinaryUtilv, .-_ZL26__cudaUnregisterBinaryUtilv
	.globl	_Z8eval_gapR9Workspace
	.type	_Z8eval_gapR9Workspace, @function
_Z8eval_gapR9Workspace:
.LFB2027:
	.cfi_startproc
	endbr64
	movq	2752(%rdi), %rcx
	movq	2744(%rdi), %rdx
	xorl	%eax, %eax
	xorps	%xmm0, %xmm0
.L3:
	movsd	(%rcx,%rax), %xmm1
	mulsd	(%rdx,%rax), %xmm1
	addq	$8, %rax
	addsd	%xmm1, %xmm0
	cmpq	$320, %rax
	jne	.L3
	ret
	.cfi_endproc
.LFE2027:
	.size	_Z8eval_gapR9Workspace, .-_Z8eval_gapR9Workspace
	.globl	_Z12set_defaultsR8Settings
	.type	_Z12set_defaultsR8Settings, @function
_Z12set_defaultsR8Settings:
.LFB2028:
	.cfi_startproc
	endbr64
	xorl	%eax, %eax
	movsd	.LC1(%rip), %xmm0
	movq	$1, 48(%rdi)
	movl	%eax, 56(%rdi)
	movq	.LC2(%rip), %rax
	movl	$1, 24(%rdi)
	movq	%rax, (%rdi)
	movq	.LC3(%rip), %rax
	movsd	%xmm0, 32(%rdi)
	movq	%rax, 8(%rdi)
	movabsq	$4294967321, %rax
	movq	%rax, 16(%rdi)
	movq	.LC4(%rip), %rax
	movsd	%xmm0, 40(%rdi)
	movq	%rax, 64(%rdi)
	ret
	.cfi_endproc
.LFE2028:
	.size	_Z12set_defaultsR8Settings, .-_Z12set_defaultsR8Settings
	.globl	_Z14setup_pointersR9WorkspaceR4Vars
	.type	_Z14setup_pointersR9WorkspaceR4Vars, @function
_Z14setup_pointersR9WorkspaceR4Vars:
.LFB2029:
	.cfi_startproc
	endbr64
	leaq	2096(%rdi), %rax
	movq	%rax, 2760(%rdi)
	leaq	2104(%rdi), %rax
	movq	%rax, 2744(%rdi)
	leaq	2424(%rdi), %rax
	addq	$1936, %rdi
	movq	%rax, 816(%rdi)
	movq	%rdi, (%rsi)
	ret
	.cfi_endproc
.LFE2029:
	.size	_Z14setup_pointersR9WorkspaceR4Vars, .-_Z14setup_pointersR9WorkspaceR4Vars
	.globl	_Z14setup_indexingR9WorkspaceR4Vars
	.type	_Z14setup_indexingR9WorkspaceR4Vars, @function
_Z14setup_indexingR9WorkspaceR4Vars:
.LFB2030:
	.cfi_startproc
	endbr64
	jmp	_Z14setup_pointersR9WorkspaceR4Vars
	.cfi_endproc
.LFE2030:
	.size	_Z14setup_indexingR9WorkspaceR4Vars, .-_Z14setup_indexingR9WorkspaceR4Vars
	.globl	_Z9set_startR9WorkspaceR8Settings
	.type	_Z9set_startR9WorkspaceR8Settings, @function
_Z9set_startR9WorkspaceR8Settings:
.LFB2031:
	.cfi_startproc
	endbr64
	leaq	1936(%rdi), %r8
	movq	%rdi, %rdx
	xorps	%xmm1, %xmm1
	xorl	%eax, %eax
	movl	$40, %ecx
	movq	%r8, %rdi
	rep stosl
	movq	2760(%rdx), %rax
	movq	2744(%rdx), %rcx
	movq	$0x000000000, (%rax)
	xorl	%eax, %eax
.L11:
	movsd	(%rdx,%rax), %xmm0
	comisd	%xmm1, %xmm0
	ja	.L10
	movsd	32(%rsi), %xmm0
.L10:
	movsd	%xmm0, (%rcx,%rax)
	addq	$8, %rax
	cmpq	$320, %rax
	jne	.L11
	movq	2752(%rdx), %rdx
	xorl	%eax, %eax
.L12:
	movsd	40(%rsi), %xmm0
	movsd	%xmm0, (%rdx,%rax,8)
	incq	%rax
	cmpq	$40, %rax
	jne	.L12
	ret
	.cfi_endproc
.LFE2031:
	.size	_Z9set_startR9WorkspaceR8Settings, .-_Z9set_startR9WorkspaceR8Settings
	.globl	_Z9eval_objvR9WorkspaceR6Params
	.type	_Z9eval_objvR9WorkspaceR6Params, @function
_Z9eval_objvR9WorkspaceR6Params:
.LFB2032:
	.cfi_startproc
	endbr64
	pushq	%rbx
	.cfi_def_cfa_offset 16
	.cfi_offset 3, -16
	movq	%rsi, %rdx
	movq	%rdi, %rbx
	leaq	1936(%rdi), %rsi
	leaq	1128(%rdi), %rdi
	call	_Z7multbyPPdS_R6Params@PLT
	xorl	%eax, %eax
	xorps	%xmm0, %xmm0
.L16:
	movsd	1936(%rbx,%rax), %xmm1
	mulsd	1128(%rbx,%rax), %xmm1
	addq	$8, %rax
	addsd	%xmm1, %xmm0
	cmpq	$160, %rax
	jne	.L16
	mulsd	.LC5(%rip), %xmm0
	xorl	%eax, %eax
.L17:
	movsd	968(%rbx,%rax), %xmm1
	mulsd	1936(%rbx,%rax), %xmm1
	addq	$8, %rax
	addsd	%xmm1, %xmm0
	cmpq	$160, %rax
	jne	.L17
	xorps	%xmm1, %xmm1
	popq	%rbx
	.cfi_def_cfa_offset 8
	addsd	%xmm1, %xmm0
	ret
	.cfi_endproc
.LFE2032:
	.size	_Z9eval_objvR9WorkspaceR6Params, .-_Z9eval_objvR9WorkspaceR6Params
	.globl	_Z11fillrhs_affR9WorkspaceR6Params
	.type	_Z11fillrhs_affR9WorkspaceR6Params, @function
_Z11fillrhs_affR9WorkspaceR6Params:
.LFB2033:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	movq	%rsi, %r15
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	leaq	1608(%rdi), %r14
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	leaq	1928(%rdi), %r13
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	leaq	1128(%rdi), %r12
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	movq	%rdi, %rbx
	subq	$24, %rsp
	.cfi_def_cfa_offset 80
	movq	2760(%rdi), %rsi
	movq	%r12, %rdi
	call	_Z9multbymATPdS_@PLT
	movq	2752(%rbx), %rsi
	leaq	4384(%rbx), %rdi
	movq	%rdi, 8(%rsp)
	call	_Z9multbymGTPdS_@PLT
	movq	8(%rsp), %rdi
	xorl	%eax, %eax
.L22:
	movsd	1128(%rbx,%rax), %xmm0
	addsd	4384(%rbx,%rax), %xmm0
	movsd	%xmm0, 1128(%rbx,%rax)
	addq	$8, %rax
	cmpq	$160, %rax
	jne	.L22
	leaq	1936(%rbx), %rbp
	movq	%r15, %rdx
	movq	%rbp, %rsi
	call	_Z7multbyPPdS_R6Params@PLT
	leaq	968(%rbx), %rax
.L23:
	movsd	3416(%rax), %xmm1
	addsd	(%rax), %xmm1
	addq	$8, %rax
	movsd	152(%rax), %xmm0
	subsd	%xmm1, %xmm0
	movsd	%xmm0, 152(%rax)
	cmpq	%rax, %r12
	jne	.L23
	movq	2752(%rbx), %rdx
	movq	.LC6(%rip), %xmm1
	xorl	%eax, %eax
.L24:
	movsd	(%rdx,%rax), %xmm0
	xorps	%xmm1, %xmm0
	movsd	%xmm0, 1288(%rbx,%rax)
	addq	$8, %rax
	cmpq	$320, %rax
	jne	.L24
	movq	%rbp, %rsi
	movq	%r14, %rdi
	call	_Z8multbymGPdS_@PLT
	movq	2744(%rbx), %rdx
	xorl	%eax, %eax
.L25:
	movsd	(%rbx,%rax), %xmm0
	subsd	(%rdx,%rax), %xmm0
	addsd	1608(%rbx,%rax), %xmm0
	movsd	%xmm0, 1608(%rbx,%rax)
	addq	$8, %rax
	cmpq	$320, %rax
	jne	.L25
	movq	%rbp, %rsi
	movq	%r13, %rdi
	call	_Z8multbymAPdS_@PLT
	movsd	1928(%rbx), %xmm0
	addsd	960(%rbx), %xmm0
	movsd	%xmm0, 1928(%rbx)
	addq	$24, %rsp
	.cfi_def_cfa_offset 56
	popq	%rbx
	.cfi_def_cfa_offset 48
	popq	%rbp
	.cfi_def_cfa_offset 40
	popq	%r12
	.cfi_def_cfa_offset 32
	popq	%r13
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE2033:
	.size	_Z11fillrhs_affR9WorkspaceR6Params, .-_Z11fillrhs_affR9WorkspaceR6Params
	.globl	_Z10fillrhs_ccR9Workspace
	.type	_Z10fillrhs_ccR9Workspace, @function
_Z10fillrhs_ccR9Workspace:
.LFB2034:
	.cfi_startproc
	endbr64
	movq	2744(%rdi), %rsi
	movq	%rdi, %rdx
	xorl	%eax, %eax
	xorps	%xmm1, %xmm1
	movq	2752(%rdi), %rcx
.L32:
	movsd	(%rsi,%rax), %xmm0
	mulsd	(%rcx,%rax), %xmm0
	addq	$8, %rax
	addsd	%xmm0, %xmm1
	cmpq	$320, %rax
	jne	.L32
	xorl	%eax, %eax
	xorps	%xmm0, %xmm0
.L35:
	movsd	2928(%rdx,%rax), %xmm3
	movsd	(%rsi,%rax), %xmm2
	movaps	%xmm2, %xmm4
	mulsd	%xmm0, %xmm4
	comisd	%xmm3, %xmm4
	jbe	.L33
	divsd	%xmm2, %xmm3
	movaps	%xmm3, %xmm0
.L33:
	addq	$8, %rax
	cmpq	$320, %rax
	jne	.L35
	xorl	%eax, %eax
.L38:
	movsd	3248(%rdx,%rax), %xmm3
	movsd	(%rcx,%rax), %xmm2
	movaps	%xmm2, %xmm4
	mulsd	%xmm0, %xmm4
	comisd	%xmm3, %xmm4
	jbe	.L36
	divsd	%xmm2, %xmm3
	movaps	%xmm3, %xmm0
.L36:
	addq	$8, %rax
	cmpq	$320, %rax
	jne	.L38
	movsd	.LC7(%rip), %xmm2
	movsd	.LC1(%rip), %xmm4
	comisd	%xmm2, %xmm0
	ja	.L39
	movaps	%xmm2, %xmm4
	divsd	%xmm0, %xmm4
.L39:
	xorl	%eax, %eax
	xorps	%xmm0, %xmm0
.L40:
	movsd	2928(%rdx,%rax), %xmm2
	movsd	3248(%rdx,%rax), %xmm3
	mulsd	%xmm4, %xmm2
	mulsd	%xmm4, %xmm3
	addsd	(%rsi,%rax), %xmm2
	addsd	(%rcx,%rax), %xmm3
	addq	$8, %rax
	mulsd	%xmm3, %xmm2
	addsd	%xmm2, %xmm0
	cmpq	$320, %rax
	jne	.L40
	divsd	%xmm1, %xmm0
	leaq	1128(%rdx), %rsi
	xorl	%eax, %eax
	movl	$40, %ecx
	mulsd	.LC8(%rip), %xmm1
	movq	%rsi, %rdi
	leaq	1608(%rdx), %rsi
	rep stosl
	movl	$82, %ecx
	movq	%rsi, %rdi
	rep stosl
	leaq	320(%rdx), %rax
	addq	$640, %rdx
	movaps	%xmm0, %xmm2
	mulsd	%xmm0, %xmm2
	mulsd	%xmm2, %xmm0
	mulsd	%xmm1, %xmm0
.L41:
	movsd	2608(%rax), %xmm2
	movaps	%xmm0, %xmm1
	addq	$8, %rax
	mulsd	2920(%rax), %xmm2
	subsd	%xmm2, %xmm1
	mulsd	-8(%rax), %xmm1
	movsd	%xmm1, 960(%rax)
	cmpq	%rax, %rdx
	jne	.L41
	ret
	.cfi_endproc
.LFE2034:
	.size	_Z10fillrhs_ccR9Workspace, .-_Z10fillrhs_ccR9Workspace
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC9:
	.string	"Initial residual before refinement has norm squared %.6g.\n"
.LC10:
	.string	"After refinement we get squared norm %.6g.\n"
	.text
	.globl	_Z6refinePdS_R9WorkspaceR8Settings
	.type	_Z6refinePdS_R9WorkspaceR8Settings, @function
_Z6refinePdS_R9WorkspaceR8Settings:
.LFB2035:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	leaq	4384(%rdx), %rax
	leaq	.LC10(%rip), %r15
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	movq	%rdx, %r14
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	movq	%rdi, %r13
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	xorl	%r12d, %r12d
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	movq	%rsi, %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	movq	%rcx, %rbx
	subq	$24, %rsp
	.cfi_def_cfa_offset 80
	movq	%rax, (%rsp)
	leaq	5192(%rdx), %rax
	movq	%rax, 8(%rsp)
.L51:
	cmpl	%r12d, 20(%rbx)
	jle	.L66
	movq	(%rsp), %rdi
	movq	%rbx, %rcx
	movq	%r14, %rdx
	movq	%rbp, %rsi
	call	_Z15matrix_multiplyPdS_R9WorkspaceR8Settings@PLT
	xorl	%eax, %eax
	xorps	%xmm1, %xmm1
.L52:
	movsd	4384(%r14,%rax), %xmm0
	subsd	0(%r13,%rax), %xmm0
	movsd	%xmm0, 4384(%r14,%rax)
	mulsd	%xmm0, %xmm0
	addq	$8, %rax
	addsd	%xmm0, %xmm1
	cmpq	$808, %rax
	jne	.L52
	cmpl	$0, 52(%rbx)
	je	.L53
	movaps	%xmm1, %xmm0
	leaq	.LC9(%rip), %rsi
	testl	%r12d, %r12d
	je	.L64
	movq	%r15, %rsi
.L64:
	movl	$2, %edi
	movb	$1, %al
	call	__printf_chk@PLT
.L53:
	movq	8(%rsp), %rsi
	movq	(%rsp), %rdi
	movq	%rbx, %rcx
	movq	%r14, %rdx
	call	_Z9ldl_solvePdS_R9WorkspaceR8Settings@PLT
	xorl	%eax, %eax
.L55:
	movsd	0(%rbp,%rax), %xmm0
	subsd	5192(%r14,%rax), %xmm0
	movsd	%xmm0, 0(%rbp,%rax)
	addq	$8, %rax
	cmpq	$808, %rax
	jne	.L55
	incl	%r12d
	jmp	.L51
.L66:
	cmpl	$0, 52(%rbx)
	je	.L50
	movq	(%rsp), %rdi
	movq	%rbx, %rcx
	movq	%r14, %rdx
	movq	%rbp, %rsi
	call	_Z15matrix_multiplyPdS_R9WorkspaceR8Settings@PLT
	xorl	%eax, %eax
	xorps	%xmm1, %xmm1
.L58:
	movsd	4384(%r14,%rax), %xmm0
	subsd	0(%r13,%rax), %xmm0
	movsd	%xmm0, 4384(%r14,%rax)
	mulsd	%xmm0, %xmm0
	addq	$8, %rax
	addsd	%xmm0, %xmm1
	cmpq	$808, %rax
	jne	.L58
	movaps	%xmm1, %xmm0
	leaq	.LC9(%rip), %rsi
	testl	%r12d, %r12d
	je	.L65
	leaq	.LC10(%rip), %rsi
.L65:
	addq	$24, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	movl	$2, %edi
	movb	$1, %al
	popq	%rbx
	.cfi_def_cfa_offset 48
	popq	%rbp
	.cfi_def_cfa_offset 40
	popq	%r12
	.cfi_def_cfa_offset 32
	popq	%r13
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	jmp	__printf_chk@PLT
.L50:
	.cfi_restore_state
	addq	$24, %rsp
	.cfi_def_cfa_offset 56
	popq	%rbx
	.cfi_def_cfa_offset 48
	popq	%rbp
	.cfi_def_cfa_offset 40
	popq	%r12
	.cfi_def_cfa_offset 32
	popq	%r13
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE2035:
	.size	_Z6refinePdS_R9WorkspaceR8Settings, .-_Z6refinePdS_R9WorkspaceR8Settings
	.globl	_Z23calc_ineq_resid_squaredR9Workspace
	.type	_Z23calc_ineq_resid_squaredR9Workspace, @function
_Z23calc_ineq_resid_squaredR9Workspace:
.LFB2036:
	.cfi_startproc
	endbr64
	pushq	%rbx
	.cfi_def_cfa_offset 16
	.cfi_offset 3, -16
	leaq	1936(%rdi), %rsi
	movq	%rdi, %rbx
	leaq	4384(%rdi), %rdi
	call	_Z8multbymGPdS_@PLT
	movq	2744(%rbx), %rdx
	xorl	%eax, %eax
.L68:
	movsd	(%rbx,%rax), %xmm0
	subsd	(%rdx,%rax), %xmm0
	addsd	4384(%rbx,%rax), %xmm0
	movsd	%xmm0, 4384(%rbx,%rax)
	addq	$8, %rax
	cmpq	$320, %rax
	jne	.L68
	xorl	%eax, %eax
	xorps	%xmm1, %xmm1
.L69:
	movsd	4384(%rbx,%rax), %xmm0
	addq	$8, %rax
	mulsd	%xmm0, %xmm0
	addsd	%xmm0, %xmm1
	cmpq	$320, %rax
	jne	.L69
	movaps	%xmm1, %xmm0
	popq	%rbx
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE2036:
	.size	_Z23calc_ineq_resid_squaredR9Workspace, .-_Z23calc_ineq_resid_squaredR9Workspace
	.globl	_Z21calc_eq_resid_squaredR9Workspace
	.type	_Z21calc_eq_resid_squaredR9Workspace, @function
_Z21calc_eq_resid_squaredR9Workspace:
.LFB2037:
	.cfi_startproc
	endbr64
	pushq	%rbx
	.cfi_def_cfa_offset 16
	.cfi_offset 3, -16
	leaq	1936(%rdi), %rsi
	movq	%rdi, %rbx
	leaq	4384(%rdi), %rdi
	call	_Z8multbymAPdS_@PLT
	movsd	4384(%rbx), %xmm0
	xorps	%xmm1, %xmm1
	addsd	960(%rbx), %xmm0
	movsd	%xmm0, 4384(%rbx)
	mulsd	%xmm0, %xmm0
	popq	%rbx
	.cfi_def_cfa_offset 8
	addsd	%xmm1, %xmm0
	ret
	.cfi_endproc
.LFE2037:
	.size	_Z21calc_eq_resid_squaredR9Workspace, .-_Z21calc_eq_resid_squaredR9Workspace
	.globl	_Z13fillrhs_startR9Workspace
	.type	_Z13fillrhs_startR9Workspace, @function
_Z13fillrhs_startR9Workspace:
.LFB2039:
	.cfi_startproc
	endbr64
	movq	.LC6(%rip), %xmm1
	movq	%rdi, %rdx
	xorl	%eax, %eax
.L76:
	movsd	968(%rdx,%rax), %xmm0
	xorps	%xmm1, %xmm0
	movsd	%xmm0, 1128(%rdx,%rax)
	addq	$8, %rax
	cmpq	$160, %rax
	jne	.L76
	leaq	1288(%rdx), %rsi
	xorl	%eax, %eax
	movl	$80, %ecx
	movq	%rsi, %rdi
	movq	%rdx, %rsi
	rep stosl
	leaq	1608(%rdx), %rax
	movl	$80, %ecx
	movq	%rax, %rdi
	rep movsl
	movsd	960(%rdx), %xmm0
	movsd	%xmm0, 1928(%rdx)
	ret
	.cfi_endproc
.LFE2039:
	.size	_Z13fillrhs_startR9Workspace, .-_Z13fillrhs_startR9Workspace
	.globl	_Z12better_startR9WorkspaceR8SettingsR6Params
	.type	_Z12better_startR9WorkspaceR8SettingsR6Params, @function
_Z12better_startR9WorkspaceR8SettingsR6Params:
.LFB2038:
	.cfi_startproc
	endbr64
	movq	.LC7(%rip), %rax
	pushq	%r12
	.cfi_def_cfa_offset 16
	.cfi_offset 12, -16
	movq	%rsi, %r12
	movq	%rdx, %rsi
	pushq	%rbp
	.cfi_def_cfa_offset 24
	.cfi_offset 6, -24
	pushq	%rbx
	.cfi_def_cfa_offset 32
	.cfi_offset 3, -32
	movq	%rdi, %rbx
	movq	%rax, 13896(%rdi)
	xorl	%eax, %eax
.L79:
	movq	.LC1(%rip), %rcx
	movq	%rcx, 640(%rbx,%rax)
	addq	$8, %rax
	cmpq	$320, %rax
	jne	.L79
	movq	%rbx, %rdi
	leaq	2768(%rbx), %rbp
	call	_Z8fill_KKTR9WorkspaceR6Params@PLT
	movq	%r12, %rsi
	movq	%rbx, %rdi
	call	_Z10ldl_factorR9WorkspaceR8Settings@PLT
	movq	%rbx, %rdi
	call	_Z13fillrhs_startR9Workspace
	movq	%r12, %rcx
	movq	%rbp, %rsi
	movq	%rbx, %rdx
	leaq	1128(%rbx), %rdi
	call	_Z9ldl_solvePdS_R9WorkspaceR8Settings@PLT
	leaq	1936(%rbx), %rax
	movq	%rbp, %rsi
	movl	$40, %ecx
	movq	%rax, %rdi
	movsd	.LC11(%rip), %xmm1
	rep movsl
	movsd	3568(%rbx), %xmm0
	movq	2760(%rbx), %rax
	movsd	%xmm0, (%rax)
	xorl	%eax, %eax
	movaps	%xmm1, %xmm0
.L81:
	movsd	3248(%rbx,%rax), %xmm2
	addq	$8, %rax
	maxsd	%xmm1, %xmm2
	movaps	%xmm2, %xmm1
	cmpq	$320, %rax
	jne	.L81
	xorps	%xmm2, %xmm2
	movq	2744(%rbx), %rdx
	comisd	%xmm1, %xmm2
	jbe	.L105
	movq	.LC6(%rip), %xmm2
	xorl	%eax, %eax
.L84:
	movsd	3248(%rbx,%rax), %xmm1
	xorps	%xmm2, %xmm1
	movsd	%xmm1, (%rdx,%rax)
	addq	$8, %rax
	cmpq	$320, %rax
	jne	.L84
.L87:
	movq	.LC6(%rip), %xmm2
	xorl	%eax, %eax
	jmp	.L85
.L105:
	addsd	.LC1(%rip), %xmm1
	xorl	%eax, %eax
.L86:
	movaps	%xmm1, %xmm2
	subsd	3248(%rbx,%rax), %xmm2
	movsd	%xmm2, (%rdx,%rax)
	addq	$8, %rax
	cmpq	$320, %rax
	jne	.L86
	jmp	.L87
.L85:
	movsd	3248(%rbx,%rax), %xmm1
	addq	$8, %rax
	xorps	%xmm2, %xmm1
	maxsd	%xmm0, %xmm1
	movaps	%xmm1, %xmm0
	cmpq	$320, %rax
	jne	.L85
	xorps	%xmm1, %xmm1
	movq	2752(%rbx), %rdx
	comisd	%xmm0, %xmm1
	jbe	.L106
	xorl	%eax, %eax
.L91:
	movsd	3248(%rbx,%rax), %xmm0
	movsd	%xmm0, (%rdx,%rax)
	addq	$8, %rax
	cmpq	$320, %rax
	jne	.L91
	jmp	.L78
.L106:
	addsd	.LC1(%rip), %xmm0
	xorl	%eax, %eax
.L92:
	movsd	3248(%rbx,%rax), %xmm1
	addsd	%xmm0, %xmm1
	movsd	%xmm1, (%rdx,%rax)
	addq	$8, %rax
	cmpq	$320, %rax
	jne	.L92
.L78:
	popq	%rbx
	.cfi_def_cfa_offset 24
	popq	%rbp
	.cfi_def_cfa_offset 16
	popq	%r12
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE2038:
	.size	_Z12better_startR9WorkspaceR8SettingsR6Params, .-_Z12better_startR9WorkspaceR8SettingsR6Params
	.section	.rodata.str1.1
.LC12:
	.string	"iter     objv        gap       |Ax-b|    |Gx+s-h|    step\n"
.LC14:
	.string	"%3d   %10.3e  %9.2e  %9.2e  %9.2e  % 6.4f\n"
	.text
	.globl	_Z5solveR9WorkspaceR8SettingsR6ParamsR4Vars
	.type	_Z5solveR9WorkspaceR8SettingsR6ParamsR4Vars, @function
_Z5solveR9WorkspaceR8SettingsR6ParamsR4Vars:
.LFB2040:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	xorl	%eax, %eax
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	movq	%rdx, %r13
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	movq	%rsi, %rbp
	movq	%rcx, %rsi
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	movq	%rdi, %rbx
	subq	$40, %rsp
	.cfi_def_cfa_offset 96
	movl	%eax, 13904(%rdi)
	call	_Z14setup_pointersR9WorkspaceR4Vars
	call	_Z7pre_opsv@PLT
	cmpl	$0, 48(%rbp)
	je	.L109
	leaq	.LC12(%rip), %rsi
	movl	$2, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
.L109:
	movq	%r13, %rsi
	movq	%rbx, %rdi
	call	_Z5fillqR9WorkspaceR6Params@PLT
	movq	%rbx, %rdi
	call	_Z5fillhR9Workspace@PLT
	movq	%rbx, %rdi
	call	_Z5fillbR9Workspace@PLT
	cmpl	$0, 24(%rbp)
	je	.L110
	movq	%r13, %rdx
	movq	%rbp, %rsi
	movq	%rbx, %rdi
	call	_Z12better_startR9WorkspaceR8SettingsR6Params
.L112:
	xorl	%r12d, %r12d
	jmp	.L111
.L110:
	movq	%rbp, %rsi
	movq	%rbx, %rdi
	call	_Z9set_startR9WorkspaceR8Settings
	jmp	.L112
.L113:
	movsd	.LC1(%rip), %xmm0
	divsd	(%rcx,%rax), %xmm0
	movsd	%xmm0, 320(%rbx,%rax)
	mulsd	(%rdx,%rax), %xmm0
	movsd	%xmm0, 640(%rbx,%rax)
	addq	$8, %rax
	cmpq	$320, %rax
	jne	.L113
	movq	%r13, %rsi
	movq	%rbx, %rdi
	movq	$0x000000000, 13896(%rbx)
	leaq	1128(%rbx), %r14
	leaq	2768(%rbx), %r15
	call	_Z8fill_KKTR9WorkspaceR6Params@PLT
	movq	%rbp, %rsi
	movq	%rbx, %rdi
	call	_Z10ldl_factorR9WorkspaceR8Settings@PLT
	movq	%r13, %rsi
	movq	%rbx, %rdi
	call	_Z11fillrhs_affR9WorkspaceR6Params
	movq	%r15, %rsi
	movq	%rbp, %rcx
	movq	%rbx, %rdx
	movq	%r14, %rdi
	call	_Z9ldl_solvePdS_R9WorkspaceR8Settings@PLT
	movq	%r15, %rsi
	movq	%rbp, %rcx
	movq	%rbx, %rdx
	movq	%r14, %rdi
	leaq	3576(%rbx), %r15
	call	_Z6refinePdS_R9WorkspaceR8Settings
	movq	%rbx, %rdi
	call	_Z10fillrhs_ccR9Workspace
	movq	%rbp, %rcx
	movq	%rbx, %rdx
	movq	%r15, %rsi
	movq	%r14, %rdi
	call	_Z9ldl_solvePdS_R9WorkspaceR8Settings@PLT
	movq	%rbp, %rcx
	movq	%rbx, %rdx
	movq	%r15, %rsi
	movq	%r14, %rdi
	call	_Z6refinePdS_R9WorkspaceR8Settings
	xorl	%eax, %eax
.L114:
	movsd	2768(%rbx,%rax), %xmm0
	addsd	3576(%rbx,%rax), %xmm0
	movsd	%xmm0, 2768(%rbx,%rax)
	addq	$8, %rax
	cmpq	$808, %rax
	jne	.L114
	movq	2744(%rbx), %rcx
	xorl	%eax, %eax
	xorps	%xmm0, %xmm0
.L117:
	movsd	2928(%rbx,%rax), %xmm2
	movsd	(%rcx,%rax), %xmm1
	movaps	%xmm1, %xmm3
	mulsd	%xmm0, %xmm3
	comisd	%xmm2, %xmm3
	jbe	.L115
	divsd	%xmm1, %xmm2
	movaps	%xmm2, %xmm0
.L115:
	addq	$8, %rax
	cmpq	$320, %rax
	jne	.L117
	movq	2752(%rbx), %rdx
	xorl	%eax, %eax
.L120:
	movsd	3248(%rbx,%rax), %xmm2
	movsd	(%rdx,%rax), %xmm1
	movaps	%xmm1, %xmm3
	mulsd	%xmm0, %xmm3
	comisd	%xmm2, %xmm3
	jbe	.L118
	divsd	%xmm1, %xmm2
	movaps	%xmm2, %xmm0
.L118:
	addq	$8, %rax
	cmpq	$320, %rax
	jne	.L120
	movsd	.LC13(%rip), %xmm1
	movsd	.LC1(%rip), %xmm4
	comisd	%xmm1, %xmm0
	ja	.L121
	divsd	%xmm0, %xmm1
	movaps	%xmm1, %xmm4
.L121:
	xorl	%eax, %eax
.L122:
	movsd	2768(%rbx,%rax), %xmm0
	mulsd	%xmm4, %xmm0
	addsd	1936(%rbx,%rax), %xmm0
	movsd	%xmm0, 1936(%rbx,%rax)
	addq	$8, %rax
	cmpq	$160, %rax
	jne	.L122
	xorl	%eax, %eax
.L123:
	movsd	2928(%rbx,%rax), %xmm0
	mulsd	%xmm4, %xmm0
	addsd	(%rcx,%rax), %xmm0
	movsd	%xmm0, (%rcx,%rax)
	addq	$8, %rax
	cmpq	$320, %rax
	jne	.L123
	xorl	%eax, %eax
.L124:
	movsd	3248(%rbx,%rax), %xmm0
	mulsd	%xmm4, %xmm0
	addsd	(%rdx,%rax), %xmm0
	movsd	%xmm0, (%rdx,%rax)
	addq	$8, %rax
	cmpq	$320, %rax
	jne	.L124
	movq	2760(%rbx), %rax
	movaps	%xmm4, %xmm0
	movq	%rbx, %rdi
	incl	%r12d
	mulsd	3568(%rbx), %xmm0
	movsd	%xmm4, 8(%rsp)
	addsd	(%rax), %xmm0
	movsd	%xmm0, (%rax)
	call	_Z8eval_gapR9Workspace
	movsd	%xmm0, 13864(%rbx)
	call	_Z21calc_eq_resid_squaredR9Workspace
	movq	%rbx, %rdi
	movsd	%xmm0, 13888(%rbx)
	call	_Z23calc_ineq_resid_squaredR9Workspace
	cmpl	$0, 48(%rbp)
	movsd	8(%rsp), %xmm4
	movsd	%xmm0, 13880(%rbx)
	je	.L125
	movq	%r13, %rsi
	movq	%rbx, %rdi
	movsd	%xmm4, 24(%rsp)
	call	_Z9eval_objvR9WorkspaceR6Params
	movsd	%xmm0, 13872(%rbx)
	movsd	%xmm0, 16(%rsp)
	movsd	13880(%rbx), %xmm0
	call	sqrt@PLT
	movsd	%xmm0, 8(%rsp)
	movsd	13888(%rbx), %xmm0
	call	sqrt@PLT
	movsd	16(%rsp), %xmm5
	movl	%r12d, %edx
	movb	$5, %al
	movsd	24(%rsp), %xmm4
	movsd	8(%rsp), %xmm3
	movaps	%xmm0, %xmm2
	leaq	.LC14(%rip), %rsi
	movsd	13864(%rbx), %xmm1
	movaps	%xmm5, %xmm0
	movl	$2, %edi
	call	__printf_chk@PLT
.L125:
	movsd	8(%rbp), %xmm0
	comisd	13864(%rbx), %xmm0
	ja	.L147
.L111:
	cmpl	%r12d, 16(%rbp)
	jle	.L146
	movq	2744(%rbx), %rcx
	movq	2752(%rbx), %rdx
	xorl	%eax, %eax
	jmp	.L113
.L147:
	movsd	0(%rbp), %xmm0
	mulsd	%xmm0, %xmm0
	comisd	13888(%rbx), %xmm0
	jb	.L111
	comisd	13880(%rbx), %xmm0
	jb	.L111
	movl	$1, 13904(%rbx)
	movq	%r13, %rsi
	movq	%rbx, %rdi
	call	_Z9eval_objvR9WorkspaceR6Params
	movsd	%xmm0, 13872(%rbx)
.L146:
	addq	$40, %rsp
	.cfi_def_cfa_offset 56
	movslq	%r12d, %rax
	popq	%rbx
	.cfi_def_cfa_offset 48
	popq	%rbp
	.cfi_def_cfa_offset 40
	popq	%r12
	.cfi_def_cfa_offset 32
	popq	%r13
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE2040:
	.size	_Z5solveR9WorkspaceR8SettingsR6ParamsR4Vars, .-_Z5solveR9WorkspaceR8SettingsR6ParamsR4Vars
	.section	.text.startup,"ax",@progbits
	.type	_ZL24__sti____cudaRegisterAllv, @function
_ZL24__sti____cudaRegisterAllv:
.LFB2066:
	.cfi_startproc
	endbr64
	pushq	%rax
	.cfi_def_cfa_offset 16
	leaq	_ZL15__fatDeviceText(%rip), %rdi
	call	__cudaRegisterFatBinary@PLT
	movq	%rax, %rdi
	movq	%rax, _ZL20__cudaFatCubinHandle(%rip)
	call	__cudaRegisterFatBinaryEnd@PLT
	leaq	_ZL26__cudaUnregisterBinaryUtilv(%rip), %rdi
	popq	%rdx
	.cfi_def_cfa_offset 8
	jmp	atexit@PLT
	.cfi_endproc
.LFE2066:
	.size	_ZL24__sti____cudaRegisterAllv, .-_ZL24__sti____cudaRegisterAllv
	.section	.init_array,"aw"
	.align 8
	.quad	_ZL24__sti____cudaRegisterAllv
	.section	.nvFatBinSegment,"aw"
	.align 8
	.type	_ZL15__fatDeviceText, @object
	.size	_ZL15__fatDeviceText, 24
_ZL15__fatDeviceText:
	.long	1180844977
	.long	1
	.quad	fatbinData
	.quad	0
	.local	_ZL20__cudaFatCubinHandle
	.comm	_ZL20__cudaFatCubinHandle,8,8
	.section	.rodata.cst8,"aM",@progbits,8
	.align 8
.LC1:
	.long	0
	.long	1072693248
	.align 8
.LC2:
	.long	-1598689907
	.long	1051772663
	.align 8
.LC3:
	.long	-350469331
	.long	1058682594
	.align 8
.LC4:
	.long	-1698910392
	.long	1048238066
	.align 8
.LC5:
	.long	0
	.long	1071644672
	.section	.rodata.cst16,"aM",@progbits,16
	.align 16
.LC6:
	.long	0
	.long	-2147483648
	.long	0
	.long	0
	.section	.rodata.cst8
	.align 8
.LC7:
	.long	0
	.long	-1074790400
	.align 8
.LC8:
	.long	-1717986918
	.long	1067030937
	.align 8
.LC11:
	.long	-1568170194
	.long	-729988434
	.align 8
.LC13:
	.long	2061584302
	.long	-1074811372
	.ident	"GCC: (Ubuntu 13.3.0-6ubuntu2~24.04) 13.3.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	1f - 0f
	.long	4f - 1f
	.long	5
0:
	.string	"GNU"
1:
	.align 8
	.long	0xc0000002
	.long	3f - 2f
2:
	.long	0x3
3:
	.align 8
4:

/* Produced by CVXGEN, 2017-11-20 12:18:49 -0500.  */
/* CVXGEN is Copyright (C) 2006-2017 Jacob Mattingley, jem@cvxgen.com. */
/* The code in this file is Copyright (C) 2006-2017 Jacob Mattingley. */
/* CVXGEN, or solvers produced by CVXGEN, cannot be used for commercial */
/* applications without prior written permission from Jacob Mattingley. */

/* Filename: solver.c. */
/* Description: Main solver file. */

#include <hip/hip_runtime.h>
#include "solver.cuh"

CUDA_CALLABLE_MEMBER
double eval_gap(Workspace& work) {
  int i;
  double gap;
  gap = 0;
  for (i = 0; i < 40; i++)
    gap += work.z[i]*work.s[i];
  return gap;
}

CUDA_CALLABLE_MEMBER
void set_defaults(Settings& settings) {
  settings.resid_tol = 1e-6;
  settings.eps = 1e-4;
  settings.max_iters = 25;
  settings.refine_steps = 1;
  settings.s_init = 1;
  settings.z_init = 1;
  settings.debug = 0;
  settings.verbose = 1;
  settings.verbose_refinement = 0;
  settings.better_start = 1;
  settings.kkt_reg = 1e-7;
}

CUDA_CALLABLE_MEMBER
void setup_pointers(Workspace& work, Vars& vars) {
  work.y = work.x + 20;
  work.s = work.x + 21;
  work.z = work.x + 61;
  vars.Weights = work.x + 0;
}

CUDA_CALLABLE_MEMBER
void setup_indexing(Workspace& work, Vars& vars) {
  setup_pointers(work, vars);
}

CUDA_CALLABLE_MEMBER
void set_start(Workspace& work, Settings& settings) {
  int i;
  for (i = 0; i < 20; i++)
    work.x[i] = 0;
  for (i = 0; i < 1; i++)
    work.y[i] = 0;
  for (i = 0; i < 40; i++)
    work.s[i] = (work.h[i] > 0) ? work.h[i] : settings.s_init;
  for (i = 0; i < 40; i++)
    work.z[i] = settings.z_init;
}

CUDA_CALLABLE_MEMBER
double eval_objv(Workspace& work, Params& params) {
  int i;
  double objv;
  /* Borrow space in work.rhs. */
  multbyP(work.rhs, work.x, params);
  objv = 0;
  for (i = 0; i < 20; i++)
    objv += work.x[i]*work.rhs[i];
  objv *= 0.5;
  for (i = 0; i < 20; i++)
    objv += work.q[i]*work.x[i];
  objv += 0;
  return objv;
}

CUDA_CALLABLE_MEMBER
void fillrhs_aff(Workspace& work, Params& params) {
  int i;
  double *r1, *r2, *r3, *r4;
  r1 = work.rhs;
  r2 = work.rhs + 20;
  r3 = work.rhs + 60;
  r4 = work.rhs + 100;
  /* r1 = -A^Ty - G^Tz - Px - q. */
  multbymAT(r1, work.y);
  multbymGT(work.buffer, work.z);
  for (i = 0; i < 20; i++)
    r1[i] += work.buffer[i];
  multbyP(work.buffer, work.x, params);
  for (i = 0; i < 20; i++)
    r1[i] -= work.buffer[i] + work.q[i];
  /* r2 = -z. */
  for (i = 0; i < 40; i++)
    r2[i] = -work.z[i];
  /* r3 = -Gx - s + h. */
  multbymG(r3, work.x);
  for (i = 0; i < 40; i++)
    r3[i] += -work.s[i] + work.h[i];
  /* r4 = -Ax + b. */
  multbymA(r4, work.x);
  for (i = 0; i < 1; i++)
    r4[i] += work.b[i];
}

CUDA_CALLABLE_MEMBER
void fillrhs_cc(Workspace& work) {
  int i;
  double *r2;
  double *ds_aff, *dz_aff;
  double mu;
  double alpha;
  double sigma;
  double smu;
  double minval;
  r2 = work.rhs + 20;
  ds_aff = work.lhs_aff + 20;
  dz_aff = work.lhs_aff + 60;
  mu = 0;
  for (i = 0; i < 40; i++)
    mu += work.s[i]*work.z[i];
  /* Don't finish calculating mu quite yet. */
  /* Find min(min(ds./s), min(dz./z)). */
  minval = 0;
  for (i = 0; i < 40; i++)
    if (ds_aff[i] < minval*work.s[i])
      minval = ds_aff[i]/work.s[i];
  for (i = 0; i < 40; i++)
    if (dz_aff[i] < minval*work.z[i])
      minval = dz_aff[i]/work.z[i];
  /* Find alpha. */
  if (-1 < minval)
      alpha = 1;
  else
      alpha = -1/minval;
  sigma = 0;
  for (i = 0; i < 40; i++)
    sigma += (work.s[i] + alpha*ds_aff[i])*
      (work.z[i] + alpha*dz_aff[i]);
  sigma /= mu;
  sigma = sigma*sigma*sigma;
  /* Finish calculating mu now. */
  mu *= 0.025;
  smu = sigma*mu;
  /* Fill-in the rhs. */
  for (i = 0; i < 20; i++)
    work.rhs[i] = 0;
  for (i = 60; i < 101; i++)
    work.rhs[i] = 0;
  for (i = 0; i < 40; i++)
    r2[i] = work.s_inv[i]*(smu - ds_aff[i]*dz_aff[i]);
}

CUDA_CALLABLE_MEMBER
void refine(double *target, double *var, Workspace& work, Settings& settings) {
  int i, j;
  double *residual = work.buffer;
  double norm2;
  double *new_var = work.buffer2;
  for (j = 0; j < settings.refine_steps; j++) {
    norm2 = 0;
    matrix_multiply(residual, var, work, settings);
    for (i = 0; i < 101; i++) {
      residual[i] = residual[i] - target[i];
      norm2 += residual[i]*residual[i];
    }
#ifndef ZERO_LIBRARY_MODE
    if (settings.verbose_refinement) {
      if (j == 0)
        printf("Initial residual before refinement has norm squared %.6g.\n", norm2);
      else
        printf("After refinement we get squared norm %.6g.\n", norm2);
    }
#endif
    /* Solve to find new_var = KKT \ (target - A*var). */
    ldl_solve(residual, new_var, work, settings);
    /* Update var += new_var, or var += KKT \ (target - A*var). */
    for (i = 0; i < 101; i++) {
      var[i] -= new_var[i];
    }
  }
#ifndef ZERO_LIBRARY_MODE
  if (settings.verbose_refinement) {
    /* Check the residual once more, but only if we're reporting it, since */
    /* it's expensive. */
    norm2 = 0;
    matrix_multiply(residual, var, work, settings);
    for (i = 0; i < 101; i++) {
      residual[i] = residual[i] - target[i];
      norm2 += residual[i]*residual[i];
    }
    if (j == 0)
      printf("Initial residual before refinement has norm squared %.6g.\n", norm2);
    else
      printf("After refinement we get squared norm %.6g.\n", norm2);
  }
#endif
}

CUDA_CALLABLE_MEMBER
double calc_ineq_resid_squared(Workspace& work) {
  /* Calculates the norm ||-Gx - s + h||. */
  double norm2_squared;
  int i;
  /* Find -Gx. */
  multbymG(work.buffer, work.x);
  /* Add -s + h. */
  for (i = 0; i < 40; i++)
    work.buffer[i] += -work.s[i] + work.h[i];
  /* Now find the squared norm. */
  norm2_squared = 0;
  for (i = 0; i < 40; i++)
    norm2_squared += work.buffer[i]*work.buffer[i];
  return norm2_squared;
}

CUDA_CALLABLE_MEMBER
double calc_eq_resid_squared(Workspace& work) {
  /* Calculates the norm ||-Ax + b||. */
  double norm2_squared;
  int i;
  /* Find -Ax. */
  multbymA(work.buffer, work.x);
  /* Add +b. */
  for (i = 0; i < 1; i++)
    work.buffer[i] += work.b[i];
  /* Now find the squared norm. */
  norm2_squared = 0;
  for (i = 0; i < 1; i++)
    norm2_squared += work.buffer[i]*work.buffer[i];
  return norm2_squared;
}

CUDA_CALLABLE_MEMBER
void better_start(Workspace& work, Settings& settings, Params& params) {
  /* Calculates a better starting point, using a similar approach to CVXOPT. */
  /* Not yet speed optimized. */
  int i;
  double *x, *s, *z, *y;
  double alpha;
  work.block_33[0] = -1;
  /* Make sure sinvz is 1 to make hijacked KKT system ok. */
  for (i = 0; i < 40; i++)
    work.s_inv_z[i] = 1;
  fill_KKT(work, params);
  ldl_factor(work, settings);
  fillrhs_start(work);
  /* Borrow work.lhs_aff for the solution. */
  ldl_solve(work.rhs, work.lhs_aff, work, settings);
  /* Don't do any refinement for now. Precision doesn't matter too much. */
  x = work.lhs_aff;
  s = work.lhs_aff + 20;
  z = work.lhs_aff + 60;
  y = work.lhs_aff + 100;
  /* Just set x and y as is. */
  for (i = 0; i < 20; i++)
    work.x[i] = x[i];
  for (i = 0; i < 1; i++)
    work.y[i] = y[i];
  /* Now complete the initialization. Start with s. */
  /* Must have alpha > max(z). */
  alpha = -1e99;
  for (i = 0; i < 40; i++)
    if (alpha < z[i])
      alpha = z[i];
  if (alpha < 0) {
    for (i = 0; i < 40; i++)
      work.s[i] = -z[i];
  } else {
    alpha += 1;
    for (i = 0; i < 40; i++)
      work.s[i] = -z[i] + alpha;
  }
  /* Now initialize z. */
  /* Now must have alpha > max(-z). */
  alpha = -1e99;
  for (i = 0; i < 40; i++)
    if (alpha < -z[i])
      alpha = -z[i];
  if (alpha < 0) {
    for (i = 0; i < 40; i++)
      work.z[i] = z[i];
  } else {
    alpha += 1;
    for (i = 0; i < 40; i++)
      work.z[i] = z[i] + alpha;
  }
}

CUDA_CALLABLE_MEMBER
void fillrhs_start(Workspace& work) {
  /* Fill rhs with (-q, 0, h, b). */
  int i;
  double *r1, *r2, *r3, *r4;
  r1 = work.rhs;
  r2 = work.rhs + 20;
  r3 = work.rhs + 60;
  r4 = work.rhs + 100;
  for (i = 0; i < 20; i++)
    r1[i] = -work.q[i];
  for (i = 0; i < 40; i++)
    r2[i] = 0;
  for (i = 0; i < 40; i++)
    r3[i] = work.h[i];
  for (i = 0; i < 1; i++)
    r4[i] = work.b[i];
}

CUDA_CALLABLE_MEMBER
long solve(Workspace& work, Settings& settings, Params& params, Vars& vars) {
  int i;
  int iter;
  double *dx, *ds, *dy, *dz;
  double minval;
  double alpha;
  work.converged = 0;
  setup_pointers(work, vars);
  pre_ops();
#ifndef ZERO_LIBRARY_MODE
  if (settings.verbose)
    printf("iter     objv        gap       |Ax-b|    |Gx+s-h|    step\n");
#endif
  fillq(work, params);
  fillh(work);
  fillb(work);
  if (settings.better_start)
    better_start(work, settings, params);
  else
    set_start(work, settings);
  for (iter = 0; iter < settings.max_iters; iter++) {
    for (i = 0; i < 40; i++) {
      work.s_inv[i] = 1.0 / work.s[i];
      work.s_inv_z[i] = work.s_inv[i]*work.z[i];
    }
    work.block_33[0] = 0;
    fill_KKT(work, params);
    ldl_factor(work, settings);
    /* Affine scaling directions. */
    fillrhs_aff(work, params);
    ldl_solve(work.rhs, work.lhs_aff, work, settings);
    refine(work.rhs, work.lhs_aff, work, settings);
    /* Centering plus corrector directions. */
    fillrhs_cc(work);
    ldl_solve(work.rhs, work.lhs_cc, work, settings);
    refine(work.rhs, work.lhs_cc, work, settings);
    /* Add the two together and store in aff. */
    for (i = 0; i < 101; i++)
      work.lhs_aff[i] += work.lhs_cc[i];
    /* Rename aff to reflect its new meaning. */
    dx = work.lhs_aff;
    ds = work.lhs_aff + 20;
    dz = work.lhs_aff + 60;
    dy = work.lhs_aff + 100;
    /* Find min(min(ds./s), min(dz./z)). */
    minval = 0;
    for (i = 0; i < 40; i++)
      if (ds[i] < minval*work.s[i])
        minval = ds[i]/work.s[i];
    for (i = 0; i < 40; i++)
      if (dz[i] < minval*work.z[i])
        minval = dz[i]/work.z[i];
    /* Find alpha. */
    if (-0.99 < minval)
      alpha = 1;
    else
      alpha = -0.99/minval;
    /* Update the primal and dual variables. */
    for (i = 0; i < 20; i++)
      work.x[i] += alpha*dx[i];
    for (i = 0; i < 40; i++)
      work.s[i] += alpha*ds[i];
    for (i = 0; i < 40; i++)
      work.z[i] += alpha*dz[i];
    for (i = 0; i < 1; i++)
      work.y[i] += alpha*dy[i];
    work.gap = eval_gap(work);
    work.eq_resid_squared = calc_eq_resid_squared(work);
    work.ineq_resid_squared = calc_ineq_resid_squared(work);
#ifndef ZERO_LIBRARY_MODE
    if (settings.verbose) {
      work.optval = eval_objv(work, params);
      printf("%3d   %10.3e  %9.2e  %9.2e  %9.2e  % 6.4f\n",
          iter+1, work.optval, work.gap, sqrt(work.eq_resid_squared),
          sqrt(work.ineq_resid_squared), alpha);
    }
#endif
    /* Test termination conditions. Requires optimality, and satisfied */
    /* constraints. */
    if (   (work.gap < settings.eps)
        && (work.eq_resid_squared <= settings.resid_tol*settings.resid_tol)
        && (work.ineq_resid_squared <= settings.resid_tol*settings.resid_tol)
       ) {
      work.converged = 1;
      work.optval = eval_objv(work, params);
      return iter+1;
    }
  }
  return iter;
}

	.text
	.file	"solver.hip"
	.globl	_Z8eval_gapR9Workspace          # -- Begin function _Z8eval_gapR9Workspace
	.type	_Z8eval_gapR9Workspace,@function
_Z8eval_gapR9Workspace:                 # @_Z8eval_gapR9Workspace
	.cfi_startproc
# %bb.0:
	movq	2744(%rdi), %rax
	movq	2752(%rdi), %rcx
	xorpd	%xmm0, %xmm0
	xorl	%edx, %edx
.LBB0_1:                                # =>This Inner Loop Header: Depth=1
	movsd	(%rcx,%rdx,8), %xmm1            # xmm1 = mem[0],zero
	mulsd	(%rax,%rdx,8), %xmm1
	addsd	%xmm1, %xmm0
	incq	%rdx
	cmpq	$40, %rdx
	jne	.LBB0_1
# %bb.2:
	retq
.Lfunc_end0:
	.size	_Z8eval_gapR9Workspace, .Lfunc_end0-_Z8eval_gapR9Workspace
	.cfi_endproc
                                        # -- End function
	.globl	_Z12set_defaultsR8Settings      # -- Begin function _Z12set_defaultsR8Settings
	.type	_Z12set_defaultsR8Settings,@function
_Z12set_defaultsR8Settings:             # @_Z12set_defaultsR8Settings
	.cfi_startproc
# %bb.0:
	movabsq	$4517329193108106637, %rax      # imm = 0x3EB0C6F7A0B5ED8D
	movq	%rax, (%rdi)
	movabsq	$4547007122018943789, %rax      # imm = 0x3F1A36E2EB1C432D
	movq	%rax, 8(%rdi)
	movabsq	$4294967321, %rax               # imm = 0x100000019
	movq	%rax, 16(%rdi)
	movabsq	$4607182418800017408, %rax      # imm = 0x3FF0000000000000
	movq	%rax, 32(%rdi)
	movq	%rax, 40(%rdi)
	movl	$0, 56(%rdi)
	movq	$1, 48(%rdi)
	movl	$1, 24(%rdi)
	movabsq	$4502148214488346440, %rax      # imm = 0x3E7AD7F29ABCAF48
	movq	%rax, 64(%rdi)
	retq
.Lfunc_end1:
	.size	_Z12set_defaultsR8Settings, .Lfunc_end1-_Z12set_defaultsR8Settings
	.cfi_endproc
                                        # -- End function
	.globl	_Z14setup_pointersR9WorkspaceR4Vars # -- Begin function _Z14setup_pointersR9WorkspaceR4Vars
	.type	_Z14setup_pointersR9WorkspaceR4Vars,@function
_Z14setup_pointersR9WorkspaceR4Vars:    # @_Z14setup_pointersR9WorkspaceR4Vars
	.cfi_startproc
# %bb.0:
	leaq	1936(%rdi), %rax
	leaq	2096(%rdi), %rcx
	movq	%rcx, 2760(%rdi)
	leaq	2104(%rdi), %rcx
	movq	%rcx, 2744(%rdi)
	leaq	2424(%rdi), %rcx
	movq	%rcx, 2752(%rdi)
	movq	%rax, (%rsi)
	retq
.Lfunc_end2:
	.size	_Z14setup_pointersR9WorkspaceR4Vars, .Lfunc_end2-_Z14setup_pointersR9WorkspaceR4Vars
	.cfi_endproc
                                        # -- End function
	.globl	_Z14setup_indexingR9WorkspaceR4Vars # -- Begin function _Z14setup_indexingR9WorkspaceR4Vars
	.type	_Z14setup_indexingR9WorkspaceR4Vars,@function
_Z14setup_indexingR9WorkspaceR4Vars:    # @_Z14setup_indexingR9WorkspaceR4Vars
	.cfi_startproc
# %bb.0:
	leaq	1936(%rdi), %rax
	leaq	2096(%rdi), %rcx
	movq	%rcx, 2760(%rdi)
	leaq	2104(%rdi), %rcx
	movq	%rcx, 2744(%rdi)
	leaq	2424(%rdi), %rcx
	movq	%rcx, 2752(%rdi)
	movq	%rax, (%rsi)
	retq
.Lfunc_end3:
	.size	_Z14setup_indexingR9WorkspaceR4Vars, .Lfunc_end3-_Z14setup_indexingR9WorkspaceR4Vars
	.cfi_endproc
                                        # -- End function
	.globl	_Z9set_startR9WorkspaceR8Settings # -- Begin function _Z9set_startR9WorkspaceR8Settings
	.type	_Z9set_startR9WorkspaceR8Settings,@function
_Z9set_startR9WorkspaceR8Settings:      # @_Z9set_startR9WorkspaceR8Settings
	.cfi_startproc
# %bb.0:                                # %.critedge
	pushq	%r15
	.cfi_def_cfa_offset 16
	pushq	%r14
	.cfi_def_cfa_offset 24
	pushq	%rbx
	.cfi_def_cfa_offset 32
	.cfi_offset %rbx, -32
	.cfi_offset %r14, -24
	.cfi_offset %r15, -16
	movq	%rsi, %rbx
	movq	%rdi, %r14
	addq	$1936, %rdi                     # imm = 0x790
	xorl	%r15d, %r15d
	movl	$160, %edx
	xorl	%esi, %esi
	callq	memset@PLT
	movq	2760(%r14), %rax
	movq	$0, (%rax)
	movq	2744(%r14), %rax
.LBB4_1:                                # =>This Inner Loop Header: Depth=1
	movsd	(%r14,%r15,8), %xmm0            # xmm0 = mem[0],zero
	xorpd	%xmm1, %xmm1
	cmpltsd	%xmm0, %xmm1
	andpd	%xmm1, %xmm0
	movsd	32(%rbx), %xmm2                 # xmm2 = mem[0],zero
	andnpd	%xmm2, %xmm1
	orpd	%xmm0, %xmm1
	movlpd	%xmm1, (%rax,%r15,8)
	incq	%r15
	cmpq	$40, %r15
	jne	.LBB4_1
# %bb.2:                                # %.preheader
	movq	2752(%r14), %rax
	movsd	40(%rbx), %xmm0                 # xmm0 = mem[0],zero
	xorl	%ecx, %ecx
.LBB4_3:                                # =>This Inner Loop Header: Depth=1
	movsd	%xmm0, (%rax,%rcx,8)
	incq	%rcx
	cmpq	$40, %rcx
	jne	.LBB4_3
# %bb.4:
	popq	%rbx
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	retq
.Lfunc_end4:
	.size	_Z9set_startR9WorkspaceR8Settings, .Lfunc_end4-_Z9set_startR9WorkspaceR8Settings
	.cfi_endproc
                                        # -- End function
	.section	.rodata.cst8,"aM",@progbits,8
	.p2align	3, 0x0                          # -- Begin function _Z9eval_objvR9WorkspaceR6Params
.LCPI5_0:
	.quad	0x3fe0000000000000              # double 0.5
	.text
	.globl	_Z9eval_objvR9WorkspaceR6Params
	.type	_Z9eval_objvR9WorkspaceR6Params,@function
_Z9eval_objvR9WorkspaceR6Params:        # @_Z9eval_objvR9WorkspaceR6Params
	.cfi_startproc
# %bb.0:
	pushq	%rbx
	.cfi_def_cfa_offset 16
	.cfi_offset %rbx, -16
	movq	%rsi, %rdx
	movq	%rdi, %rbx
	addq	$1128, %rdi                     # imm = 0x468
	leaq	1936(%rbx), %rsi
	callq	_Z7multbyPPdS_R6Params
	xorpd	%xmm0, %xmm0
	xorl	%eax, %eax
.LBB5_1:                                # =>This Inner Loop Header: Depth=1
	movsd	1936(%rbx,%rax,8), %xmm1        # xmm1 = mem[0],zero
	mulsd	1128(%rbx,%rax,8), %xmm1
	addsd	%xmm1, %xmm0
	incq	%rax
	cmpq	$20, %rax
	jne	.LBB5_1
# %bb.2:
	mulsd	.LCPI5_0(%rip), %xmm0
	xorl	%eax, %eax
.LBB5_3:                                # =>This Inner Loop Header: Depth=1
	movsd	968(%rbx,%rax,8), %xmm1         # xmm1 = mem[0],zero
	mulsd	1936(%rbx,%rax,8), %xmm1
	addsd	%xmm1, %xmm0
	incq	%rax
	cmpq	$20, %rax
	jne	.LBB5_3
# %bb.4:
	xorpd	%xmm1, %xmm1
	addsd	%xmm1, %xmm0
	popq	%rbx
	.cfi_def_cfa_offset 8
	retq
.Lfunc_end5:
	.size	_Z9eval_objvR9WorkspaceR6Params, .Lfunc_end5-_Z9eval_objvR9WorkspaceR6Params
	.cfi_endproc
                                        # -- End function
	.section	.rodata.cst16,"aM",@progbits,16
	.p2align	4, 0x0                          # -- Begin function _Z11fillrhs_affR9WorkspaceR6Params
.LCPI6_0:
	.quad	0x8000000000000000              # double -0
	.quad	0x8000000000000000              # double -0
	.text
	.globl	_Z11fillrhs_affR9WorkspaceR6Params
	.type	_Z11fillrhs_affR9WorkspaceR6Params,@function
_Z11fillrhs_affR9WorkspaceR6Params:     # @_Z11fillrhs_affR9WorkspaceR6Params
	.cfi_startproc
# %bb.0:
	pushq	%r15
	.cfi_def_cfa_offset 16
	pushq	%r14
	.cfi_def_cfa_offset 24
	pushq	%r12
	.cfi_def_cfa_offset 32
	pushq	%rbx
	.cfi_def_cfa_offset 40
	pushq	%rax
	.cfi_def_cfa_offset 48
	.cfi_offset %rbx, -40
	.cfi_offset %r12, -32
	.cfi_offset %r14, -24
	.cfi_offset %r15, -16
	movq	%rsi, %r15
	movq	%rdi, %rbx
	leaq	1128(%rdi), %r14
	movq	2760(%rdi), %rsi
	movq	%r14, %rdi
	callq	_Z9multbymATPdS_
	leaq	4384(%rbx), %r12
	movq	2752(%rbx), %rsi
	movq	%r12, %rdi
	callq	_Z9multbymGTPdS_
	xorl	%eax, %eax
.LBB6_1:                                # =>This Inner Loop Header: Depth=1
	movsd	3256(%r14,%rax,8), %xmm0        # xmm0 = mem[0],zero
	addsd	(%r14,%rax,8), %xmm0
	movsd	%xmm0, (%r14,%rax,8)
	incq	%rax
	cmpq	$20, %rax
	jne	.LBB6_1
# %bb.2:
	leaq	1936(%rbx), %r14
	movq	%r12, %rdi
	movq	%r14, %rsi
	movq	%r15, %rdx
	callq	_Z7multbyPPdS_R6Params
	xorl	%eax, %eax
.LBB6_3:                                # =>This Inner Loop Header: Depth=1
	movsd	4384(%rbx,%rax,8), %xmm0        # xmm0 = mem[0],zero
	addsd	968(%rbx,%rax,8), %xmm0
	movsd	1128(%rbx,%rax,8), %xmm1        # xmm1 = mem[0],zero
	subsd	%xmm0, %xmm1
	movsd	%xmm1, 1128(%rbx,%rax,8)
	incq	%rax
	cmpq	$20, %rax
	jne	.LBB6_3
# %bb.4:                                # %.preheader
	movq	2752(%rbx), %rax
	xorl	%ecx, %ecx
	movapd	.LCPI6_0(%rip), %xmm0           # xmm0 = [-0.0E+0,-0.0E+0]
.LBB6_5:                                # =>This Inner Loop Header: Depth=1
	movsd	(%rax,%rcx,8), %xmm1            # xmm1 = mem[0],zero
	xorpd	%xmm0, %xmm1
	movlpd	%xmm1, 1288(%rbx,%rcx,8)
	incq	%rcx
	cmpq	$40, %rcx
	jne	.LBB6_5
# %bb.6:
	leaq	1608(%rbx), %r15
	movq	%r15, %rdi
	movq	%r14, %rsi
	callq	_Z8multbymGPdS_
	movq	2744(%rbx), %rax
	xorl	%ecx, %ecx
.LBB6_7:                                # =>This Inner Loop Header: Depth=1
	movsd	-1608(%r15,%rcx,8), %xmm0       # xmm0 = mem[0],zero
	subsd	(%rax,%rcx,8), %xmm0
	addsd	(%r15,%rcx,8), %xmm0
	movsd	%xmm0, (%r15,%rcx,8)
	incq	%rcx
	cmpq	$40, %rcx
	jne	.LBB6_7
# %bb.8:                                # %.critedge
	leaq	1928(%rbx), %rdi
	movq	%r14, %rsi
	callq	_Z8multbymAPdS_
	movsd	960(%rbx), %xmm0                # xmm0 = mem[0],zero
	addsd	1928(%rbx), %xmm0
	movsd	%xmm0, 1928(%rbx)
	addq	$8, %rsp
	.cfi_def_cfa_offset 40
	popq	%rbx
	.cfi_def_cfa_offset 32
	popq	%r12
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	retq
.Lfunc_end6:
	.size	_Z11fillrhs_affR9WorkspaceR6Params, .Lfunc_end6-_Z11fillrhs_affR9WorkspaceR6Params
	.cfi_endproc
                                        # -- End function
	.section	.rodata.cst8,"aM",@progbits,8
	.p2align	3, 0x0                          # -- Begin function _Z10fillrhs_ccR9Workspace
.LCPI7_0:
	.quad	0xbff0000000000000              # double -1
.LCPI7_1:
	.quad	0x3ff0000000000000              # double 1
.LCPI7_2:
	.quad	0x3f9999999999999a              # double 0.025000000000000001
	.text
	.globl	_Z10fillrhs_ccR9Workspace
	.type	_Z10fillrhs_ccR9Workspace,@function
_Z10fillrhs_ccR9Workspace:              # @_Z10fillrhs_ccR9Workspace
	.cfi_startproc
# %bb.0:
	pushq	%rbx
	.cfi_def_cfa_offset 16
	subq	$32, %rsp
	.cfi_def_cfa_offset 48
	.cfi_offset %rbx, -16
	movq	%rdi, %rbx
	movq	2744(%rdi), %rax
	movq	2752(%rdi), %rcx
	xorpd	%xmm5, %xmm5
	xorl	%edx, %edx
.LBB7_1:                                # =>This Inner Loop Header: Depth=1
	movsd	(%rax,%rdx,8), %xmm0            # xmm0 = mem[0],zero
	mulsd	(%rcx,%rdx,8), %xmm0
	addsd	%xmm0, %xmm5
	incq	%rdx
	cmpq	$40, %rdx
	jne	.LBB7_1
# %bb.2:                                # %.preheader84
	xorpd	%xmm0, %xmm0
	xorl	%edx, %edx
.LBB7_3:                                # =>This Inner Loop Header: Depth=1
	movsd	2928(%rbx,%rdx,8), %xmm1        # xmm1 = mem[0],zero
	movsd	(%rax,%rdx,8), %xmm2            # xmm2 = mem[0],zero
	movapd	%xmm0, %xmm3
	mulsd	%xmm2, %xmm3
	movapd	%xmm1, %xmm4
	divsd	%xmm2, %xmm4
	cmpltsd	%xmm3, %xmm1
	andpd	%xmm1, %xmm4
	andnpd	%xmm0, %xmm1
	orpd	%xmm4, %xmm1
	movapd	%xmm1, %xmm0
	incq	%rdx
	cmpq	$40, %rdx
	jne	.LBB7_3
# %bb.4:                                # %.preheader83
	xorl	%edx, %edx
.LBB7_5:                                # =>This Inner Loop Header: Depth=1
	movsd	3248(%rbx,%rdx,8), %xmm1        # xmm1 = mem[0],zero
	movsd	(%rcx,%rdx,8), %xmm2            # xmm2 = mem[0],zero
	movapd	%xmm0, %xmm3
	mulsd	%xmm2, %xmm3
	movapd	%xmm1, %xmm4
	divsd	%xmm2, %xmm4
	cmpltsd	%xmm3, %xmm1
	andpd	%xmm1, %xmm4
	andnpd	%xmm0, %xmm1
	orpd	%xmm4, %xmm1
	incq	%rdx
	movapd	%xmm1, %xmm0
	cmpq	$40, %rdx
	jne	.LBB7_5
# %bb.6:
	movsd	.LCPI7_0(%rip), %xmm2           # xmm2 = mem[0],zero
	movapd	%xmm2, %xmm3
	divsd	%xmm1, %xmm3
	cmpltsd	%xmm1, %xmm2
	movsd	.LCPI7_1(%rip), %xmm0           # xmm0 = mem[0],zero
	andpd	%xmm2, %xmm0
	andnpd	%xmm3, %xmm2
	orpd	%xmm2, %xmm0
	xorpd	%xmm3, %xmm3
	xorl	%edx, %edx
.LBB7_7:                                # =>This Inner Loop Header: Depth=1
	movsd	2928(%rbx,%rdx,8), %xmm1        # xmm1 = mem[0],zero
	mulsd	%xmm0, %xmm1
	addsd	(%rax,%rdx,8), %xmm1
	movsd	3248(%rbx,%rdx,8), %xmm2        # xmm2 = mem[0],zero
	mulsd	%xmm0, %xmm2
	addsd	(%rcx,%rdx,8), %xmm2
	mulsd	%xmm1, %xmm2
	addsd	%xmm2, %xmm3
	incq	%rdx
	cmpq	$40, %rdx
	jne	.LBB7_7
# %bb.8:                                # %.preheader82.preheader
	divsd	%xmm5, %xmm3
	movsd	%xmm3, 16(%rsp)                 # 8-byte Spill
	movapd	%xmm3, %xmm0
	mulsd	%xmm3, %xmm0
	movsd	%xmm0, 8(%rsp)                  # 8-byte Spill
	mulsd	.LCPI7_2(%rip), %xmm5
	movsd	%xmm5, 24(%rsp)                 # 8-byte Spill
	leaq	1128(%rbx), %rdi
	movl	$160, %edx
	xorl	%esi, %esi
	callq	memset@PLT
	movsd	8(%rsp), %xmm0                  # 8-byte Reload
                                        # xmm0 = mem[0],zero
	mulsd	16(%rsp), %xmm0                 # 8-byte Folded Reload
	mulsd	24(%rsp), %xmm0                 # 8-byte Folded Reload
	movsd	%xmm0, 8(%rsp)                  # 8-byte Spill
	leaq	1608(%rbx), %rdi
	movl	$328, %edx                      # imm = 0x148
	xorl	%esi, %esi
	callq	memset@PLT
	movsd	8(%rsp), %xmm2                  # 8-byte Reload
                                        # xmm2 = mem[0],zero
	movq	$-40, %rax
.LBB7_9:                                # %.preheader
                                        # =>This Inner Loop Header: Depth=1
	movsd	3248(%rbx,%rax,8), %xmm0        # xmm0 = mem[0],zero
	mulsd	3568(%rbx,%rax,8), %xmm0
	movapd	%xmm2, %xmm1
	subsd	%xmm0, %xmm1
	mulsd	640(%rbx,%rax,8), %xmm1
	movsd	%xmm1, 1608(%rbx,%rax,8)
	incq	%rax
	jne	.LBB7_9
# %bb.10:
	addq	$32, %rsp
	.cfi_def_cfa_offset 16
	popq	%rbx
	.cfi_def_cfa_offset 8
	retq
.Lfunc_end7:
	.size	_Z10fillrhs_ccR9Workspace, .Lfunc_end7-_Z10fillrhs_ccR9Workspace
	.cfi_endproc
                                        # -- End function
	.globl	_Z6refinePdS_R9WorkspaceR8Settings # -- Begin function _Z6refinePdS_R9WorkspaceR8Settings
	.type	_Z6refinePdS_R9WorkspaceR8Settings,@function
_Z6refinePdS_R9WorkspaceR8Settings:     # @_Z6refinePdS_R9WorkspaceR8Settings
	.cfi_startproc
# %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	pushq	%r15
	.cfi_def_cfa_offset 24
	pushq	%r14
	.cfi_def_cfa_offset 32
	pushq	%r13
	.cfi_def_cfa_offset 40
	pushq	%r12
	.cfi_def_cfa_offset 48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	subq	$24, %rsp
	.cfi_def_cfa_offset 80
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	.cfi_offset %rbp, -16
	movq	%rcx, %r15
	movq	%rdx, %r12
	movq	%rsi, %r13
	movq	%rdi, %rbx
	leaq	4384(%rdx), %rdi
	movl	20(%rcx), %eax
	movl	%eax, 12(%rsp)                  # 4-byte Spill
	testl	%eax, %eax
	jle	.LBB8_9
# %bb.1:                                # %.lr.ph
	leaq	5192(%r12), %rbp
	xorl	%r14d, %r14d
	movq	%rdi, 16(%rsp)                  # 8-byte Spill
.LBB8_2:                                # =>This Loop Header: Depth=1
                                        #     Child Loop BB8_3 Depth 2
                                        #     Child Loop BB8_7 Depth 2
	movq	%r13, %rsi
	movq	%r12, %rdx
	movq	%r15, %rcx
	callq	_Z15matrix_multiplyPdS_R9WorkspaceR8Settings
	xorpd	%xmm0, %xmm0
	movl	$548, %eax                      # imm = 0x224
.LBB8_3:                                #   Parent Loop BB8_2 Depth=1
                                        # =>  This Inner Loop Header: Depth=2
	movsd	(%r12,%rax,8), %xmm1            # xmm1 = mem[0],zero
	subsd	-4384(%rbx,%rax,8), %xmm1
	movsd	%xmm1, (%r12,%rax,8)
	mulsd	%xmm1, %xmm1
	addsd	%xmm1, %xmm0
	incq	%rax
	cmpq	$649, %rax                      # imm = 0x289
	jne	.LBB8_3
# %bb.4:                                #   in Loop: Header=BB8_2 Depth=1
	cmpl	$0, 52(%r15)
	je	.LBB8_6
# %bb.5:                                # %.sink.split
                                        #   in Loop: Header=BB8_2 Depth=1
	testl	%r14d, %r14d
	movl	$.L.str.1, %edi
	movl	$.L.str, %eax
	cmoveq	%rax, %rdi
	movb	$1, %al
	callq	printf
.LBB8_6:                                #   in Loop: Header=BB8_2 Depth=1
	movq	16(%rsp), %rdi                  # 8-byte Reload
	movq	%rbp, %rsi
	movq	%r12, %rdx
	movq	%r15, %rcx
	callq	_Z9ldl_solvePdS_R9WorkspaceR8Settings
	xorl	%eax, %eax
.LBB8_7:                                #   Parent Loop BB8_2 Depth=1
                                        # =>  This Inner Loop Header: Depth=2
	movsd	(%r13,%rax,8), %xmm0            # xmm0 = mem[0],zero
	subsd	(%rbp,%rax,8), %xmm0
	movsd	%xmm0, (%r13,%rax,8)
	incq	%rax
	cmpq	$101, %rax
	jne	.LBB8_7
# %bb.8:                                #   in Loop: Header=BB8_2 Depth=1
	incl	%r14d
	cmpl	20(%r15), %r14d
	movq	16(%rsp), %rdi                  # 8-byte Reload
	jl	.LBB8_2
.LBB8_9:                                # %._crit_edge
	cmpl	$0, 52(%r15)
	je	.LBB8_13
# %bb.10:
	movq	%rdi, %r14
	movq	%r13, %rsi
	movq	%r12, %rdx
	movq	%r15, %rcx
	callq	_Z15matrix_multiplyPdS_R9WorkspaceR8Settings
	xorpd	%xmm0, %xmm0
	xorl	%eax, %eax
.LBB8_11:                               # =>This Inner Loop Header: Depth=1
	movsd	(%r14,%rax,8), %xmm1            # xmm1 = mem[0],zero
	subsd	(%rbx,%rax,8), %xmm1
	movsd	%xmm1, (%r14,%rax,8)
	mulsd	%xmm1, %xmm1
	addsd	%xmm1, %xmm0
	incq	%rax
	cmpq	$101, %rax
	jne	.LBB8_11
# %bb.12:                               # %.sink.split77
	cmpl	$0, 12(%rsp)                    # 4-byte Folded Reload
	movl	$.L.str, %eax
	movl	$.L.str.1, %edi
	cmovleq	%rax, %rdi
	movb	$1, %al
	addq	$24, %rsp
	.cfi_def_cfa_offset 56
	popq	%rbx
	.cfi_def_cfa_offset 48
	popq	%r12
	.cfi_def_cfa_offset 40
	popq	%r13
	.cfi_def_cfa_offset 32
	popq	%r14
	.cfi_def_cfa_offset 24
	popq	%r15
	.cfi_def_cfa_offset 16
	popq	%rbp
	.cfi_def_cfa_offset 8
	jmp	printf                          # TAILCALL
.LBB8_13:
	.cfi_def_cfa_offset 80
	addq	$24, %rsp
	.cfi_def_cfa_offset 56
	popq	%rbx
	.cfi_def_cfa_offset 48
	popq	%r12
	.cfi_def_cfa_offset 40
	popq	%r13
	.cfi_def_cfa_offset 32
	popq	%r14
	.cfi_def_cfa_offset 24
	popq	%r15
	.cfi_def_cfa_offset 16
	popq	%rbp
	.cfi_def_cfa_offset 8
	retq
.Lfunc_end8:
	.size	_Z6refinePdS_R9WorkspaceR8Settings, .Lfunc_end8-_Z6refinePdS_R9WorkspaceR8Settings
	.cfi_endproc
                                        # -- End function
	.globl	_Z23calc_ineq_resid_squaredR9Workspace # -- Begin function _Z23calc_ineq_resid_squaredR9Workspace
	.type	_Z23calc_ineq_resid_squaredR9Workspace,@function
_Z23calc_ineq_resid_squaredR9Workspace: # @_Z23calc_ineq_resid_squaredR9Workspace
	.cfi_startproc
# %bb.0:
	pushq	%rbx
	.cfi_def_cfa_offset 16
	.cfi_offset %rbx, -16
	movq	%rdi, %rbx
	addq	$4384, %rdi                     # imm = 0x1120
	leaq	1936(%rbx), %rsi
	callq	_Z8multbymGPdS_
	movq	2744(%rbx), %rax
	xorl	%ecx, %ecx
.LBB9_1:                                # =>This Inner Loop Header: Depth=1
	movsd	(%rbx,%rcx,8), %xmm0            # xmm0 = mem[0],zero
	subsd	(%rax,%rcx,8), %xmm0
	addsd	4384(%rbx,%rcx,8), %xmm0
	movsd	%xmm0, 4384(%rbx,%rcx,8)
	incq	%rcx
	cmpq	$40, %rcx
	jne	.LBB9_1
# %bb.2:                                # %.preheader.preheader
	xorpd	%xmm0, %xmm0
	xorl	%eax, %eax
.LBB9_3:                                # %.preheader
                                        # =>This Inner Loop Header: Depth=1
	movsd	4384(%rbx,%rax,8), %xmm1        # xmm1 = mem[0],zero
	mulsd	%xmm1, %xmm1
	addsd	%xmm1, %xmm0
	incq	%rax
	cmpq	$40, %rax
	jne	.LBB9_3
# %bb.4:
	popq	%rbx
	.cfi_def_cfa_offset 8
	retq
.Lfunc_end9:
	.size	_Z23calc_ineq_resid_squaredR9Workspace, .Lfunc_end9-_Z23calc_ineq_resid_squaredR9Workspace
	.cfi_endproc
                                        # -- End function
	.globl	_Z21calc_eq_resid_squaredR9Workspace # -- Begin function _Z21calc_eq_resid_squaredR9Workspace
	.type	_Z21calc_eq_resid_squaredR9Workspace,@function
_Z21calc_eq_resid_squaredR9Workspace:   # @_Z21calc_eq_resid_squaredR9Workspace
	.cfi_startproc
# %bb.0:                                # %.critedge
	pushq	%rbx
	.cfi_def_cfa_offset 16
	.cfi_offset %rbx, -16
	movq	%rdi, %rbx
	addq	$4384, %rdi                     # imm = 0x1120
	leaq	1936(%rbx), %rsi
	callq	_Z8multbymAPdS_
	movsd	960(%rbx), %xmm0                # xmm0 = mem[0],zero
	addsd	4384(%rbx), %xmm0
	movsd	%xmm0, 4384(%rbx)
	mulsd	%xmm0, %xmm0
	popq	%rbx
	.cfi_def_cfa_offset 8
	retq
.Lfunc_end10:
	.size	_Z21calc_eq_resid_squaredR9Workspace, .Lfunc_end10-_Z21calc_eq_resid_squaredR9Workspace
	.cfi_endproc
                                        # -- End function
	.section	.rodata.cst16,"aM",@progbits,16
	.p2align	4, 0x0                          # -- Begin function _Z12better_startR9WorkspaceR8SettingsR6Params
.LCPI11_0:
	.quad	0x8000000000000000              # double -0
	.quad	0x8000000000000000              # double -0
	.section	.rodata.cst8,"aM",@progbits,8
	.p2align	3, 0x0
.LCPI11_1:
	.quad	0xd47d42aea2879f2e              # double -9.9999999999999997E+98
.LCPI11_2:
	.quad	0x3ff0000000000000              # double 1
	.text
	.globl	_Z12better_startR9WorkspaceR8SettingsR6Params
	.type	_Z12better_startR9WorkspaceR8SettingsR6Params,@function
_Z12better_startR9WorkspaceR8SettingsR6Params: # @_Z12better_startR9WorkspaceR8SettingsR6Params
	.cfi_startproc
# %bb.0:
	pushq	%r15
	.cfi_def_cfa_offset 16
	pushq	%r14
	.cfi_def_cfa_offset 24
	pushq	%r12
	.cfi_def_cfa_offset 32
	pushq	%rbx
	.cfi_def_cfa_offset 40
	pushq	%rax
	.cfi_def_cfa_offset 48
	.cfi_offset %rbx, -40
	.cfi_offset %r12, -32
	.cfi_offset %r14, -24
	.cfi_offset %r15, -16
	movq	%rsi, %r14
	movq	%rdi, %rbx
	movabsq	$-4616189618054758400, %rax     # imm = 0xBFF0000000000000
	movq	%rax, 13896(%rdi)
	movl	$80, %eax
	movabsq	$4607182418800017408, %rcx      # imm = 0x3FF0000000000000
.LBB11_1:                               # =>This Inner Loop Header: Depth=1
	movq	%rcx, (%rbx,%rax,8)
	incq	%rax
	cmpq	$120, %rax
	jne	.LBB11_1
# %bb.2:
	movq	%rbx, %rdi
	movq	%rdx, %rsi
	callq	_Z8fill_KKTR9WorkspaceR6Params
	movq	%rbx, %rdi
	movq	%r14, %rsi
	callq	_Z10ldl_factorR9WorkspaceR8Settings
	leaq	1128(%rbx), %r15
	movl	$121, %eax
.LBB11_3:                               # =>This Inner Loop Header: Depth=1
	movsd	(%rbx,%rax,8), %xmm0            # xmm0 = mem[0],zero
	xorps	.LCPI11_0(%rip), %xmm0
	movlps	%xmm0, 160(%rbx,%rax,8)
	incq	%rax
	cmpq	$141, %rax
	jne	.LBB11_3
# %bb.4:                                # %.preheader25.preheader.i
	leaq	1288(%rbx), %rdi
	xorl	%r12d, %r12d
	movl	$320, %edx                      # imm = 0x140
	xorl	%esi, %esi
	callq	memset@PLT
.LBB11_5:                               # %.preheader.i
                                        # =>This Inner Loop Header: Depth=1
	movsd	(%rbx,%r12,8), %xmm0            # xmm0 = mem[0],zero
	movsd	%xmm0, 1608(%rbx,%r12,8)
	incq	%r12
	cmpq	$40, %r12
	jne	.LBB11_5
# %bb.6:                                # %_Z13fillrhs_startR9Workspace.exit
	movsd	960(%rbx), %xmm0                # xmm0 = mem[0],zero
	movsd	%xmm0, 1928(%rbx)
	leaq	2768(%rbx), %r12
	movq	%r15, %rdi
	movq	%r12, %rsi
	movq	%rbx, %rdx
	movq	%r14, %rcx
	callq	_Z9ldl_solvePdS_R9WorkspaceR8Settings
	leaq	1936(%rbx), %rdi
	movl	$160, %edx
	movq	%r12, %rsi
	callq	memcpy@PLT
	movsd	3568(%rbx), %xmm0               # xmm0 = mem[0],zero
	movq	2760(%rbx), %rax
	movsd	%xmm0, (%rax)
	movsd	.LCPI11_1(%rip), %xmm0          # xmm0 = mem[0],zero
	xorl	%eax, %eax
.LBB11_7:                               # =>This Inner Loop Header: Depth=1
	movapd	%xmm0, %xmm1
	movsd	3248(%rbx,%rax,8), %xmm0        # xmm0 = mem[0],zero
	maxsd	%xmm1, %xmm0
	incq	%rax
	cmpq	$40, %rax
	jne	.LBB11_7
# %bb.8:
	xorpd	%xmm1, %xmm1
	ucomisd	%xmm0, %xmm1
	movapd	.LCPI11_0(%rip), %xmm2          # xmm2 = [-0.0E+0,-0.0E+0]
	jbe	.LBB11_11
# %bb.9:                                # %.preheader80
	movq	2744(%rbx), %rax
	xorl	%ecx, %ecx
.LBB11_10:                              # =>This Inner Loop Header: Depth=1
	movsd	3248(%rbx,%rcx,8), %xmm0        # xmm0 = mem[0],zero
	xorpd	%xmm2, %xmm0
	movlpd	%xmm0, (%rax,%rcx,8)
	incq	%rcx
	cmpq	$40, %rcx
	jne	.LBB11_10
	jmp	.LBB11_13
.LBB11_11:
	addsd	.LCPI11_2(%rip), %xmm0
	movq	2744(%rbx), %rax
	xorl	%ecx, %ecx
.LBB11_12:                              # =>This Inner Loop Header: Depth=1
	movapd	%xmm0, %xmm1
	subsd	3248(%rbx,%rcx,8), %xmm1
	movsd	%xmm1, (%rax,%rcx,8)
	incq	%rcx
	cmpq	$40, %rcx
	jne	.LBB11_12
.LBB11_13:                              # %.loopexit81.preheader
	movsd	.LCPI11_1(%rip), %xmm0          # xmm0 = mem[0],zero
	xorl	%eax, %eax
.LBB11_14:                              # %.loopexit81
                                        # =>This Inner Loop Header: Depth=1
	movapd	%xmm0, %xmm1
	movsd	3248(%rbx,%rax,8), %xmm0        # xmm0 = mem[0],zero
	xorpd	%xmm2, %xmm0
	maxsd	%xmm1, %xmm0
	incq	%rax
	cmpq	$40, %rax
	jne	.LBB11_14
# %bb.15:
	xorpd	%xmm1, %xmm1
	ucomisd	%xmm0, %xmm1
	jbe	.LBB11_18
# %bb.16:                               # %.preheader
	movq	2752(%rbx), %rax
	xorl	%ecx, %ecx
.LBB11_17:                              # =>This Inner Loop Header: Depth=1
	movsd	3248(%rbx,%rcx,8), %xmm0        # xmm0 = mem[0],zero
	movsd	%xmm0, (%rax,%rcx,8)
	incq	%rcx
	cmpq	$40, %rcx
	jne	.LBB11_17
	jmp	.LBB11_20
.LBB11_18:
	addsd	.LCPI11_2(%rip), %xmm0
	movq	2752(%rbx), %rax
	xorl	%ecx, %ecx
.LBB11_19:                              # =>This Inner Loop Header: Depth=1
	movsd	3248(%rbx,%rcx,8), %xmm1        # xmm1 = mem[0],zero
	addsd	%xmm0, %xmm1
	movsd	%xmm1, (%rax,%rcx,8)
	incq	%rcx
	cmpq	$40, %rcx
	jne	.LBB11_19
.LBB11_20:                              # %.loopexit
	addq	$8, %rsp
	.cfi_def_cfa_offset 40
	popq	%rbx
	.cfi_def_cfa_offset 32
	popq	%r12
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	retq
.Lfunc_end11:
	.size	_Z12better_startR9WorkspaceR8SettingsR6Params, .Lfunc_end11-_Z12better_startR9WorkspaceR8SettingsR6Params
	.cfi_endproc
                                        # -- End function
	.section	.rodata.cst16,"aM",@progbits,16
	.p2align	4, 0x0                          # -- Begin function _Z13fillrhs_startR9Workspace
.LCPI12_0:
	.quad	0x8000000000000000              # double -0
	.quad	0x8000000000000000              # double -0
	.text
	.globl	_Z13fillrhs_startR9Workspace
	.type	_Z13fillrhs_startR9Workspace,@function
_Z13fillrhs_startR9Workspace:           # @_Z13fillrhs_startR9Workspace
	.cfi_startproc
# %bb.0:
	pushq	%r14
	.cfi_def_cfa_offset 16
	pushq	%rbx
	.cfi_def_cfa_offset 24
	pushq	%rax
	.cfi_def_cfa_offset 32
	.cfi_offset %rbx, -24
	.cfi_offset %r14, -16
	movq	%rdi, %rbx
	addq	$1288, %rdi                     # imm = 0x508
	movq	$-20, %rax
	movaps	.LCPI12_0(%rip), %xmm0          # xmm0 = [-0.0E+0,-0.0E+0]
.LBB12_1:                               # =>This Inner Loop Header: Depth=1
	movsd	1128(%rbx,%rax,8), %xmm1        # xmm1 = mem[0],zero
	xorps	%xmm0, %xmm1
	movlps	%xmm1, 1288(%rbx,%rax,8)
	incq	%rax
	jne	.LBB12_1
# %bb.2:                                # %.preheader25.preheader
	xorl	%r14d, %r14d
	movl	$320, %edx                      # imm = 0x140
	xorl	%esi, %esi
	callq	memset@PLT
.LBB12_3:                               # %.preheader
                                        # =>This Inner Loop Header: Depth=1
	movsd	(%rbx,%r14,8), %xmm0            # xmm0 = mem[0],zero
	movsd	%xmm0, 1608(%rbx,%r14,8)
	incq	%r14
	cmpq	$40, %r14
	jne	.LBB12_3
# %bb.4:                                # %.critedge
	movsd	960(%rbx), %xmm0                # xmm0 = mem[0],zero
	movsd	%xmm0, 1928(%rbx)
	addq	$8, %rsp
	.cfi_def_cfa_offset 24
	popq	%rbx
	.cfi_def_cfa_offset 16
	popq	%r14
	.cfi_def_cfa_offset 8
	retq
.Lfunc_end12:
	.size	_Z13fillrhs_startR9Workspace, .Lfunc_end12-_Z13fillrhs_startR9Workspace
	.cfi_endproc
                                        # -- End function
	.section	.rodata.cst8,"aM",@progbits,8
	.p2align	3, 0x0                          # -- Begin function _Z5solveR9WorkspaceR8SettingsR6ParamsR4Vars
.LCPI13_0:
	.quad	0x3ff0000000000000              # double 1
.LCPI13_1:
	.quad	0xbfefae147ae147ae              # double -0.98999999999999999
.LCPI13_2:
	.quad	0x0000000000000000              # double 0
	.text
	.globl	_Z5solveR9WorkspaceR8SettingsR6ParamsR4Vars
	.type	_Z5solveR9WorkspaceR8SettingsR6ParamsR4Vars,@function
_Z5solveR9WorkspaceR8SettingsR6ParamsR4Vars: # @_Z5solveR9WorkspaceR8SettingsR6ParamsR4Vars
	.cfi_startproc
# %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	pushq	%r15
	.cfi_def_cfa_offset 24
	pushq	%r14
	.cfi_def_cfa_offset 32
	pushq	%r13
	.cfi_def_cfa_offset 40
	pushq	%r12
	.cfi_def_cfa_offset 48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	subq	$88, %rsp
	.cfi_def_cfa_offset 144
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	.cfi_offset %rbp, -16
	movq	%rdx, %r14
	movq	%rsi, %r15
	movq	%rdi, %rbx
	movl	$0, 13904(%rdi)
	leaq	1936(%rdi), %rdx
	leaq	2096(%rdi), %rax
	movq	%rax, 2760(%rdi)
	leaq	2104(%rdi), %rax
	movq	%rax, 2744(%rdi)
	leaq	2424(%rdi), %rax
	movq	%rax, 2752(%rdi)
	movq	%rdx, 40(%rsp)                  # 8-byte Spill
	movq	%rdx, (%rcx)
	callq	_Z7pre_opsv
	cmpl	$0, 48(%r15)
	je	.LBB13_2
# %bb.1:
	movl	$.Lstr, %edi
	callq	puts@PLT
.LBB13_2:
	movq	%rbx, %rdi
	movq	%r14, %rsi
	callq	_Z5fillqR9WorkspaceR6Params
	movq	%rbx, %rdi
	callq	_Z5fillhR9Workspace
	movq	%rbx, %rdi
	callq	_Z5fillbR9Workspace
	cmpl	$0, 24(%r15)
	je	.LBB13_4
# %bb.3:
	movq	%rbx, %rdi
	movq	%r15, %rsi
	movq	%r14, %rdx
	callq	_Z12better_startR9WorkspaceR8SettingsR6Params
	jmp	.LBB13_5
.LBB13_4:
	movq	%rbx, %rdi
	movq	%r15, %rsi
	callq	_Z9set_startR9WorkspaceR8Settings
.LBB13_5:
	cmpl	$0, 16(%r15)
	jle	.LBB13_6
# %bb.7:                                # %.preheader160.lr.ph
	leaq	1128(%rbx), %r13
	leaq	2768(%rbx), %rax
	movq	%rax, 32(%rsp)                  # 8-byte Spill
	leaq	3576(%rbx), %rax
	movq	%rax, 24(%rsp)                  # 8-byte Spill
	leaq	4384(%rbx), %rax
	movq	%rax, 16(%rsp)                  # 8-byte Spill
	xorl	%ebp, %ebp
	movsd	.LCPI13_0(%rip), %xmm1          # xmm1 = mem[0],zero
.LBB13_8:                               # %.preheader160
                                        # =>This Loop Header: Depth=1
                                        #     Child Loop BB13_9 Depth 2
                                        #     Child Loop BB13_11 Depth 2
                                        #     Child Loop BB13_13 Depth 2
                                        #     Child Loop BB13_15 Depth 2
                                        #     Child Loop BB13_17 Depth 2
                                        #     Child Loop BB13_19 Depth 2
                                        #     Child Loop BB13_21 Depth 2
                                        #     Child Loop BB13_23 Depth 2
	movq	2744(%rbx), %rax
	movq	2752(%rbx), %rcx
	xorl	%edx, %edx
.LBB13_9:                               #   Parent Loop BB13_8 Depth=1
                                        # =>  This Inner Loop Header: Depth=2
	movapd	%xmm1, %xmm0
	divsd	(%rax,%rdx,8), %xmm0
	movsd	%xmm0, 320(%rbx,%rdx,8)
	mulsd	(%rcx,%rdx,8), %xmm0
	movsd	%xmm0, 640(%rbx,%rdx,8)
	incq	%rdx
	cmpq	$40, %rdx
	jne	.LBB13_9
# %bb.10:                               #   in Loop: Header=BB13_8 Depth=1
	movq	$0, 13896(%rbx)
	movq	%rbx, %rdi
	movq	%r14, %rsi
	callq	_Z8fill_KKTR9WorkspaceR6Params
	movq	%rbx, %rdi
	movq	%r15, %rsi
	callq	_Z10ldl_factorR9WorkspaceR8Settings
	movq	%rbx, %rdi
	movq	%r14, %rsi
	callq	_Z11fillrhs_affR9WorkspaceR6Params
	movq	%r13, %rdi
	movq	32(%rsp), %r12                  # 8-byte Reload
	movq	%r12, %rsi
	movq	%rbx, %rdx
	movq	%r15, %rcx
	callq	_Z9ldl_solvePdS_R9WorkspaceR8Settings
	movq	%r13, %rdi
	movq	%r12, %rsi
	movq	%rbx, %rdx
	movq	%r15, %rcx
	callq	_Z6refinePdS_R9WorkspaceR8Settings
	movq	%rbx, %rdi
	callq	_Z10fillrhs_ccR9Workspace
	movq	%r13, %rdi
	movq	24(%rsp), %r12                  # 8-byte Reload
	movq	%r12, %rsi
	movq	%rbx, %rdx
	movq	%r15, %rcx
	callq	_Z9ldl_solvePdS_R9WorkspaceR8Settings
	movq	%r13, %rdi
	movq	%r12, %rsi
	movq	%rbx, %rdx
	movq	%r15, %rcx
	callq	_Z6refinePdS_R9WorkspaceR8Settings
	movl	$346, %eax                      # imm = 0x15A
.LBB13_11:                              #   Parent Loop BB13_8 Depth=1
                                        # =>  This Inner Loop Header: Depth=2
	movsd	808(%rbx,%rax,8), %xmm0         # xmm0 = mem[0],zero
	addsd	(%rbx,%rax,8), %xmm0
	movsd	%xmm0, (%rbx,%rax,8)
	incq	%rax
	cmpq	$447, %rax                      # imm = 0x1BF
	jne	.LBB13_11
# %bb.12:                               #   in Loop: Header=BB13_8 Depth=1
	movq	2744(%rbx), %rax
	xorpd	%xmm0, %xmm0
	xorl	%ecx, %ecx
.LBB13_13:                              #   Parent Loop BB13_8 Depth=1
                                        # =>  This Inner Loop Header: Depth=2
	movsd	2928(%rbx,%rcx,8), %xmm1        # xmm1 = mem[0],zero
	movsd	(%rax,%rcx,8), %xmm2            # xmm2 = mem[0],zero
	movapd	%xmm0, %xmm3
	mulsd	%xmm2, %xmm3
	movapd	%xmm1, %xmm4
	divsd	%xmm2, %xmm4
	cmpltsd	%xmm3, %xmm1
	andpd	%xmm1, %xmm4
	andnpd	%xmm0, %xmm1
	orpd	%xmm4, %xmm1
	movapd	%xmm1, %xmm0
	incq	%rcx
	cmpq	$40, %rcx
	jne	.LBB13_13
# %bb.14:                               # %.preheader159
                                        #   in Loop: Header=BB13_8 Depth=1
	movq	2752(%rbx), %rcx
	xorl	%edx, %edx
.LBB13_15:                              #   Parent Loop BB13_8 Depth=1
                                        # =>  This Inner Loop Header: Depth=2
	movsd	3248(%rbx,%rdx,8), %xmm1        # xmm1 = mem[0],zero
	movsd	(%rcx,%rdx,8), %xmm2            # xmm2 = mem[0],zero
	movapd	%xmm0, %xmm3
	mulsd	%xmm2, %xmm3
	movapd	%xmm1, %xmm4
	divsd	%xmm2, %xmm4
	cmpltsd	%xmm3, %xmm1
	andpd	%xmm1, %xmm4
	andnpd	%xmm0, %xmm1
	orpd	%xmm4, %xmm1
	incq	%rdx
	movapd	%xmm1, %xmm0
	cmpq	$40, %rdx
	jne	.LBB13_15
# %bb.16:                               #   in Loop: Header=BB13_8 Depth=1
	movsd	.LCPI13_1(%rip), %xmm2          # xmm2 = mem[0],zero
	movapd	%xmm2, %xmm0
	divsd	%xmm1, %xmm0
	cmpltsd	%xmm1, %xmm2
	movapd	%xmm2, %xmm1
	andnpd	%xmm0, %xmm1
	movsd	.LCPI13_0(%rip), %xmm0          # xmm0 = mem[0],zero
	andpd	%xmm0, %xmm2
	orpd	%xmm1, %xmm2
	movl	$242, %edx
.LBB13_17:                              #   Parent Loop BB13_8 Depth=1
                                        # =>  This Inner Loop Header: Depth=2
	movsd	832(%rbx,%rdx,8), %xmm0         # xmm0 = mem[0],zero
	mulsd	%xmm2, %xmm0
	addsd	(%rbx,%rdx,8), %xmm0
	movsd	%xmm0, (%rbx,%rdx,8)
	incq	%rdx
	cmpq	$262, %rdx                      # imm = 0x106
	jne	.LBB13_17
# %bb.18:                               # %.preheader158.preheader
                                        #   in Loop: Header=BB13_8 Depth=1
	xorl	%edx, %edx
.LBB13_19:                              # %.preheader158
                                        #   Parent Loop BB13_8 Depth=1
                                        # =>  This Inner Loop Header: Depth=2
	movsd	2928(%rbx,%rdx,8), %xmm0        # xmm0 = mem[0],zero
	mulsd	%xmm2, %xmm0
	addsd	(%rax,%rdx,8), %xmm0
	movsd	%xmm0, (%rax,%rdx,8)
	incq	%rdx
	cmpq	$40, %rdx
	jne	.LBB13_19
# %bb.20:                               # %.preheader.preheader
                                        #   in Loop: Header=BB13_8 Depth=1
	xorl	%edx, %edx
.LBB13_21:                              # %.preheader
                                        #   Parent Loop BB13_8 Depth=1
                                        # =>  This Inner Loop Header: Depth=2
	movsd	3248(%rbx,%rdx,8), %xmm0        # xmm0 = mem[0],zero
	mulsd	%xmm2, %xmm0
	addsd	(%rcx,%rdx,8), %xmm0
	movsd	%xmm0, (%rcx,%rdx,8)
	incq	%rdx
	cmpq	$40, %rdx
	jne	.LBB13_21
# %bb.22:                               # %.critedge
                                        #   in Loop: Header=BB13_8 Depth=1
	movsd	3568(%rbx), %xmm0               # xmm0 = mem[0],zero
	movapd	%xmm2, 64(%rsp)                 # 16-byte Spill
	mulsd	%xmm2, %xmm0
	movq	2760(%rbx), %rdx
	addsd	(%rdx), %xmm0
	movsd	%xmm0, (%rdx)
	xorpd	%xmm0, %xmm0
	xorl	%edx, %edx
.LBB13_23:                              #   Parent Loop BB13_8 Depth=1
                                        # =>  This Inner Loop Header: Depth=2
	movsd	(%rcx,%rdx,8), %xmm1            # xmm1 = mem[0],zero
	mulsd	(%rax,%rdx,8), %xmm1
	addsd	%xmm1, %xmm0
	incq	%rdx
	cmpq	$40, %rdx
	jne	.LBB13_23
# %bb.24:                               # %_Z8eval_gapR9Workspace.exit
                                        #   in Loop: Header=BB13_8 Depth=1
	movsd	%xmm0, 13864(%rbx)
	movq	16(%rsp), %rdi                  # 8-byte Reload
	movq	40(%rsp), %rsi                  # 8-byte Reload
	callq	_Z8multbymAPdS_
	movsd	960(%rbx), %xmm0                # xmm0 = mem[0],zero
	addsd	4384(%rbx), %xmm0
	movsd	%xmm0, 4384(%rbx)
	mulsd	%xmm0, %xmm0
	movsd	%xmm0, 13888(%rbx)
	movq	%rbx, %rdi
	callq	_Z23calc_ineq_resid_squaredR9Workspace
	movsd	%xmm0, 13880(%rbx)
	cmpl	$0, 48(%r15)
	je	.LBB13_32
# %bb.25:                               #   in Loop: Header=BB13_8 Depth=1
	movq	%rbx, %rdi
	movq	%r14, %rsi
	callq	_Z9eval_objvR9WorkspaceR6Params
	movsd	%xmm0, 56(%rsp)                 # 8-byte Spill
	movsd	%xmm0, 13872(%rbx)
	movsd	13864(%rbx), %xmm0              # xmm0 = mem[0],zero
	movsd	%xmm0, 48(%rsp)                 # 8-byte Spill
	movsd	13888(%rbx), %xmm0              # xmm0 = mem[0],zero
	ucomisd	.LCPI13_2(%rip), %xmm0
	jb	.LBB13_27
# %bb.26:                               #   in Loop: Header=BB13_8 Depth=1
	xorps	%xmm2, %xmm2
	sqrtsd	%xmm0, %xmm2
	jmp	.LBB13_28
.LBB13_27:                              # %call.sqrt
                                        #   in Loop: Header=BB13_8 Depth=1
	callq	sqrt
	movapd	%xmm0, %xmm2
.LBB13_28:                              # %.split
                                        #   in Loop: Header=BB13_8 Depth=1
	movsd	13880(%rbx), %xmm0              # xmm0 = mem[0],zero
	ucomisd	.LCPI13_2(%rip), %xmm0
	jb	.LBB13_30
# %bb.29:                               #   in Loop: Header=BB13_8 Depth=1
	sqrtsd	%xmm0, %xmm3
	jmp	.LBB13_31
.LBB13_30:                              # %call.sqrt234
                                        #   in Loop: Header=BB13_8 Depth=1
	movsd	%xmm2, 8(%rsp)                  # 8-byte Spill
	callq	sqrt
	movsd	8(%rsp), %xmm2                  # 8-byte Reload
                                        # xmm2 = mem[0],zero
	movapd	%xmm0, %xmm3
.LBB13_31:                              # %.split.split
                                        #   in Loop: Header=BB13_8 Depth=1
	movapd	64(%rsp), %xmm4                 # 16-byte Reload
	leal	1(%rbp), %esi
	movl	$.L.str.3, %edi
	movsd	56(%rsp), %xmm0                 # 8-byte Reload
                                        # xmm0 = mem[0],zero
	movsd	48(%rsp), %xmm1                 # 8-byte Reload
                                        # xmm1 = mem[0],zero
	movb	$5, %al
	callq	printf
.LBB13_32:                              #   in Loop: Header=BB13_8 Depth=1
	movsd	8(%r15), %xmm0                  # xmm0 = mem[0],zero
	ucomisd	13864(%rbx), %xmm0
	jbe	.LBB13_36
# %bb.33:                               #   in Loop: Header=BB13_8 Depth=1
	movsd	(%r15), %xmm0                   # xmm0 = mem[0],zero
	mulsd	%xmm0, %xmm0
	ucomisd	13888(%rbx), %xmm0
	jb	.LBB13_36
# %bb.34:                               #   in Loop: Header=BB13_8 Depth=1
	ucomisd	13880(%rbx), %xmm0
	jae	.LBB13_35
.LBB13_36:                              #   in Loop: Header=BB13_8 Depth=1
	incl	%ebp
	cmpl	16(%r15), %ebp
	movsd	.LCPI13_0(%rip), %xmm1          # xmm1 = mem[0],zero
	jl	.LBB13_8
	jmp	.LBB13_37
.LBB13_6:
	xorl	%ebp, %ebp
	jmp	.LBB13_37
.LBB13_35:
	movl	$1, 13904(%rbx)
	movq	%rbx, %rdi
	movq	%r14, %rsi
	callq	_Z9eval_objvR9WorkspaceR6Params
	movsd	%xmm0, 13872(%rbx)
	incl	%ebp
.LBB13_37:                              # %.loopexit
	movl	%ebp, %eax
	addq	$88, %rsp
	.cfi_def_cfa_offset 56
	popq	%rbx
	.cfi_def_cfa_offset 48
	popq	%r12
	.cfi_def_cfa_offset 40
	popq	%r13
	.cfi_def_cfa_offset 32
	popq	%r14
	.cfi_def_cfa_offset 24
	popq	%r15
	.cfi_def_cfa_offset 16
	popq	%rbp
	.cfi_def_cfa_offset 8
	retq
.Lfunc_end13:
	.size	_Z5solveR9WorkspaceR8SettingsR6ParamsR4Vars, .Lfunc_end13-_Z5solveR9WorkspaceR8SettingsR6ParamsR4Vars
	.cfi_endproc
                                        # -- End function
	.type	.L.str,@object                  # @.str
	.section	.rodata.str1.1,"aMS",@progbits,1
.L.str:
	.asciz	"Initial residual before refinement has norm squared %.6g.\n"
	.size	.L.str, 59

	.type	.L.str.1,@object                # @.str.1
.L.str.1:
	.asciz	"After refinement we get squared norm %.6g.\n"
	.size	.L.str.1, 44

	.type	.L.str.3,@object                # @.str.3
.L.str.3:
	.asciz	"%3d   %10.3e  %9.2e  %9.2e  %9.2e  % 6.4f\n"
	.size	.L.str.3, 43

	.type	__hip_cuid_,@object             # @__hip_cuid_
	.bss
	.globl	__hip_cuid_
__hip_cuid_:
	.byte	0                               # 0x0
	.size	__hip_cuid_, 1

	.type	.Lstr,@object                   # @str
	.section	.rodata.str1.1,"aMS",@progbits,1
.Lstr:
	.asciz	"iter     objv        gap       |Ax-b|    |Gx+s-h|    step"
	.size	.Lstr, 58

	.ident	"AMD clang version 18.0.0git (https://github.com/RadeonOpenCompute/llvm-project roc-6.3.2 25012 e5bf7e55c91490b07c49d8960fa7983d864936c4)"
	.section	".note.GNU-stack","",@progbits
	.addrsig
	.addrsig_sym __hip_cuid_

	.text
	.p2alignl 7, 3214868480
	.fill 96, 4, 3214868480
	.type	__hip_cuid_,@object             ; @__hip_cuid_
	.section	.bss,"aw",@nobits
	.globl	__hip_cuid_
__hip_cuid_:
	.byte	0                               ; 0x0
	.size	__hip_cuid_, 1

	.ident	"AMD clang version 18.0.0git (https://github.com/RadeonOpenCompute/llvm-project roc-6.3.2 25012 e5bf7e55c91490b07c49d8960fa7983d864936c4)"
	.section	".note.GNU-stack","",@progbits
	.addrsig
	.addrsig_sym __hip_cuid_
	.amdgcn_target "amdgcn-amd-amdhsa--gfx1100"
	.amdgpu_metadata
---
amdhsa.kernels:  []
amdhsa.target:   amdgcn-amd-amdhsa--gfx1100
amdhsa.version:
  - 1
  - 2
...

	.end_amdgpu_metadata
