int ls_cost_nm2_f0(const double **arg, double **res, int *iw, double *w,
                   int mem) {
  double a0 = arg[0] ? arg[0][0] : 0;
  if (res[0] != 0)
    res[0][0] = a0;
  a0 = arg[0] ? arg[0][1] : 0;
  if (res[0] != 0)
    res[0][1] = a0;
  a0 = arg[0] ? arg[0][2] : 0;
  if (res[0] != 0)
    res[0][2] = a0;
  a0 = arg[0] ? arg[0][3] : 0;
  if (res[0] != 0)
    res[0][3] = a0;
  a0 = arg[0] ? arg[0][4] : 0;
  if (res[0] != 0)
    res[0][4] = a0;
  a0 = arg[0] ? arg[0][5] : 0;
  if (res[0] != 0)
    res[0][5] = a0;
  a0 = arg[1] ? arg[1][0] : 0;
  if (res[0] != 0)
    res[0][6] = a0;
  a0 = arg[1] ? arg[1][1] : 0;
  if (res[0] != 0)
    res[0][7] = a0;
  a0 = arg[1] ? arg[1][2] : 0;
  if (res[0] != 0)
    res[0][8] = a0;
  a0 = 1.;
  if (res[1] != 0)
    res[1][0] = a0;
  if (res[1] != 0)
    res[1][1] = a0;
  if (res[1] != 0)
    res[1][2] = a0;
  if (res[1] != 0)
    res[1][3] = a0;
  if (res[1] != 0)
    res[1][4] = a0;
  if (res[1] != 0)
    res[1][5] = a0;
  if (res[1] != 0)
    res[1][6] = a0;
  if (res[1] != 0)
    res[1][7] = a0;
  if (res[1] != 0)
    res[1][8] = a0;
  return 0;
}


x86 assembly (clang, -O0):
<ls_cost_nm2_f0>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8d,-0x24(%rbp)
mov    -0x8(%rbp),%rax
cmpq   $0x0,(%rax)
je     113b <ls_cost_nm2_f0+0x3b>
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
movsd  (%rax),%xmm0
movsd  %xmm0,-0x38(%rbp)
jmp    1148 <ls_cost_nm2_f0+0x48>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x38(%rbp)
jmp    1148 <ls_cost_nm2_f0+0x48>
movsd  -0x38(%rbp),%xmm0
movsd  %xmm0,-0x30(%rbp)
mov    -0x10(%rbp),%rax
cmpq   $0x0,(%rax)
je     1170 <ls_cost_nm2_f0+0x70>
movsd  -0x30(%rbp),%xmm0
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
movsd  %xmm0,(%rax)
mov    -0x8(%rbp),%rax
cmpq   $0x0,(%rax)
je     1194 <ls_cost_nm2_f0+0x94>
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
movsd  0x8(%rax),%xmm0
movsd  %xmm0,-0x40(%rbp)
jmp    11a1 <ls_cost_nm2_f0+0xa1>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x40(%rbp)
jmp    11a1 <ls_cost_nm2_f0+0xa1>
movsd  -0x40(%rbp),%xmm0
movsd  %xmm0,-0x30(%rbp)
mov    -0x10(%rbp),%rax
cmpq   $0x0,(%rax)
je     11ca <ls_cost_nm2_f0+0xca>
movsd  -0x30(%rbp),%xmm0
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
movsd  %xmm0,0x8(%rax)
mov    -0x8(%rbp),%rax
cmpq   $0x0,(%rax)
je     11ee <ls_cost_nm2_f0+0xee>
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
movsd  0x10(%rax),%xmm0
movsd  %xmm0,-0x48(%rbp)
jmp    11fb <ls_cost_nm2_f0+0xfb>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x48(%rbp)
jmp    11fb <ls_cost_nm2_f0+0xfb>
movsd  -0x48(%rbp),%xmm0
movsd  %xmm0,-0x30(%rbp)
mov    -0x10(%rbp),%rax
cmpq   $0x0,(%rax)
je     1224 <ls_cost_nm2_f0+0x124>
movsd  -0x30(%rbp),%xmm0
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
movsd  %xmm0,0x10(%rax)
mov    -0x8(%rbp),%rax
cmpq   $0x0,(%rax)
je     1248 <ls_cost_nm2_f0+0x148>
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
movsd  0x18(%rax),%xmm0
movsd  %xmm0,-0x50(%rbp)
jmp    1255 <ls_cost_nm2_f0+0x155>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x50(%rbp)
jmp    1255 <ls_cost_nm2_f0+0x155>
movsd  -0x50(%rbp),%xmm0
movsd  %xmm0,-0x30(%rbp)
mov    -0x10(%rbp),%rax
cmpq   $0x0,(%rax)
je     127e <ls_cost_nm2_f0+0x17e>
movsd  -0x30(%rbp),%xmm0
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
movsd  %xmm0,0x18(%rax)
mov    -0x8(%rbp),%rax
cmpq   $0x0,(%rax)
je     12a2 <ls_cost_nm2_f0+0x1a2>
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
movsd  0x20(%rax),%xmm0
movsd  %xmm0,-0x58(%rbp)
jmp    12af <ls_cost_nm2_f0+0x1af>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x58(%rbp)
jmp    12af <ls_cost_nm2_f0+0x1af>
movsd  -0x58(%rbp),%xmm0
movsd  %xmm0,-0x30(%rbp)
mov    -0x10(%rbp),%rax
cmpq   $0x0,(%rax)
je     12d8 <ls_cost_nm2_f0+0x1d8>
movsd  -0x30(%rbp),%xmm0
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
movsd  %xmm0,0x20(%rax)
mov    -0x8(%rbp),%rax
cmpq   $0x0,(%rax)
je     12fc <ls_cost_nm2_f0+0x1fc>
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
movsd  0x28(%rax),%xmm0
movsd  %xmm0,-0x60(%rbp)
jmp    1309 <ls_cost_nm2_f0+0x209>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x60(%rbp)
jmp    1309 <ls_cost_nm2_f0+0x209>
movsd  -0x60(%rbp),%xmm0
movsd  %xmm0,-0x30(%rbp)
mov    -0x10(%rbp),%rax
cmpq   $0x0,(%rax)
je     1332 <ls_cost_nm2_f0+0x232>
movsd  -0x30(%rbp),%xmm0
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
movsd  %xmm0,0x28(%rax)
mov    -0x8(%rbp),%rax
cmpq   $0x0,0x8(%rax)
je     1357 <ls_cost_nm2_f0+0x257>
mov    -0x8(%rbp),%rax
mov    0x8(%rax),%rax
movsd  (%rax),%xmm0
movsd  %xmm0,-0x68(%rbp)
jmp    1364 <ls_cost_nm2_f0+0x264>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x68(%rbp)
jmp    1364 <ls_cost_nm2_f0+0x264>
movsd  -0x68(%rbp),%xmm0
movsd  %xmm0,-0x30(%rbp)
mov    -0x10(%rbp),%rax
cmpq   $0x0,(%rax)
je     138d <ls_cost_nm2_f0+0x28d>
movsd  -0x30(%rbp),%xmm0
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
movsd  %xmm0,0x30(%rax)
mov    -0x8(%rbp),%rax
cmpq   $0x0,0x8(%rax)
je     13b3 <ls_cost_nm2_f0+0x2b3>
mov    -0x8(%rbp),%rax
mov    0x8(%rax),%rax
movsd  0x8(%rax),%xmm0
movsd  %xmm0,-0x70(%rbp)
jmp    13c0 <ls_cost_nm2_f0+0x2c0>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x70(%rbp)
jmp    13c0 <ls_cost_nm2_f0+0x2c0>
movsd  -0x70(%rbp),%xmm0
movsd  %xmm0,-0x30(%rbp)
mov    -0x10(%rbp),%rax
cmpq   $0x0,(%rax)
je     13e9 <ls_cost_nm2_f0+0x2e9>
movsd  -0x30(%rbp),%xmm0
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
movsd  %xmm0,0x38(%rax)
mov    -0x8(%rbp),%rax
cmpq   $0x0,0x8(%rax)
je     140f <ls_cost_nm2_f0+0x30f>
mov    -0x8(%rbp),%rax
mov    0x8(%rax),%rax
movsd  0x10(%rax),%xmm0
movsd  %xmm0,-0x78(%rbp)
jmp    141c <ls_cost_nm2_f0+0x31c>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x78(%rbp)
jmp    141c <ls_cost_nm2_f0+0x31c>
movsd  -0x78(%rbp),%xmm0
movsd  %xmm0,-0x30(%rbp)
mov    -0x10(%rbp),%rax
cmpq   $0x0,(%rax)
je     1445 <ls_cost_nm2_f0+0x345>
movsd  -0x30(%rbp),%xmm0
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
movsd  %xmm0,0x40(%rax)
movsd  0xbb3(%rip),%xmm0
movsd  %xmm0,-0x30(%rbp)
mov    -0x10(%rbp),%rax
cmpq   $0x0,0x8(%rax)
je     1472 <ls_cost_nm2_f0+0x372>
movsd  -0x30(%rbp),%xmm0
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rax
movsd  %xmm0,(%rax)
mov    -0x10(%rbp),%rax
cmpq   $0x0,0x8(%rax)
je     1493 <ls_cost_nm2_f0+0x393>
movsd  -0x30(%rbp),%xmm0
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rax
movsd  %xmm0,0x8(%rax)
mov    -0x10(%rbp),%rax
cmpq   $0x0,0x8(%rax)
je     14b4 <ls_cost_nm2_f0+0x3b4>
movsd  -0x30(%rbp),%xmm0
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rax
movsd  %xmm0,0x10(%rax)
mov    -0x10(%rbp),%rax
cmpq   $0x0,0x8(%rax)
je     14d5 <ls_cost_nm2_f0+0x3d5>
movsd  -0x30(%rbp),%xmm0
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rax
movsd  %xmm0,0x18(%rax)
mov    -0x10(%rbp),%rax
cmpq   $0x0,0x8(%rax)
je     14f6 <ls_cost_nm2_f0+0x3f6>
movsd  -0x30(%rbp),%xmm0
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rax
movsd  %xmm0,0x20(%rax)
mov    -0x10(%rbp),%rax
cmpq   $0x0,0x8(%rax)
je     1517 <ls_cost_nm2_f0+0x417>
movsd  -0x30(%rbp),%xmm0
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rax
movsd  %xmm0,0x28(%rax)
mov    -0x10(%rbp),%rax
cmpq   $0x0,0x8(%rax)
je     1538 <ls_cost_nm2_f0+0x438>
movsd  -0x30(%rbp),%xmm0
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rax
movsd  %xmm0,0x30(%rax)
mov    -0x10(%rbp),%rax
cmpq   $0x0,0x8(%rax)
je     1559 <ls_cost_nm2_f0+0x459>
movsd  -0x30(%rbp),%xmm0
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rax
movsd  %xmm0,0x38(%rax)
mov    -0x10(%rbp),%rax
cmpq   $0x0,0x8(%rax)
je     157a <ls_cost_nm2_f0+0x47a>
movsd  -0x30(%rbp),%xmm0
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rax
movsd  %xmm0,0x40(%rax)
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ls_cost_nm2_f0>:
mov    (%rdi),%rcx
test   %rcx,%rcx
je     110e <ls_cost_nm2_f0+0xe>
movsd  (%rcx),%xmm0
jmp    1111 <ls_cost_nm2_f0+0x11>
xorps  %xmm0,%xmm0
mov    (%rsi),%rax
test   %rax,%rax
je     111d <ls_cost_nm2_f0+0x1d>
movsd  %xmm0,(%rax)
test   %rcx,%rcx
je     1210 <ls_cost_nm2_f0+0x110>
movsd  0x8(%rcx),%xmm0
test   %rax,%rax
je     1135 <ls_cost_nm2_f0+0x35>
movsd  %xmm0,0x8(%rax)
test   %rcx,%rcx
je     1221 <ls_cost_nm2_f0+0x121>
movsd  0x10(%rcx),%xmm0
test   %rax,%rax
je     114d <ls_cost_nm2_f0+0x4d>
movsd  %xmm0,0x10(%rax)
test   %rcx,%rcx
je     1232 <ls_cost_nm2_f0+0x132>
movsd  0x18(%rcx),%xmm0
test   %rax,%rax
je     1165 <ls_cost_nm2_f0+0x65>
movsd  %xmm0,0x18(%rax)
test   %rcx,%rcx
je     1243 <ls_cost_nm2_f0+0x143>
movsd  0x20(%rcx),%xmm0
test   %rax,%rax
je     117d <ls_cost_nm2_f0+0x7d>
movsd  %xmm0,0x20(%rax)
test   %rcx,%rcx
je     1254 <ls_cost_nm2_f0+0x154>
movsd  0x28(%rcx),%xmm0
test   %rax,%rax
je     1195 <ls_cost_nm2_f0+0x95>
movsd  %xmm0,0x28(%rax)
mov    0x8(%rdi),%rcx
test   %rcx,%rcx
je     1265 <ls_cost_nm2_f0+0x165>
movsd  (%rcx),%xmm0
test   %rax,%rax
je     11b0 <ls_cost_nm2_f0+0xb0>
movsd  %xmm0,0x30(%rax)
test   %rcx,%rcx
je     1276 <ls_cost_nm2_f0+0x176>
movsd  0x8(%rcx),%xmm0
test   %rax,%rax
je     11c8 <ls_cost_nm2_f0+0xc8>
movsd  %xmm0,0x38(%rax)
test   %rcx,%rcx
je     1287 <ls_cost_nm2_f0+0x187>
movsd  0x10(%rcx),%xmm0
test   %rax,%rax
je     11e0 <ls_cost_nm2_f0+0xe0>
movsd  %xmm0,0x40(%rax)
mov    0x8(%rsi),%rax
test   %rax,%rax
je     120d <ls_cost_nm2_f0+0x10d>
movaps 0xe10(%rip),%xmm0
movups %xmm0,(%rax)
movups %xmm0,0x10(%rax)
movups %xmm0,0x20(%rax)
movups %xmm0,0x30(%rax)
movabs $0x3ff0000000000000,%rcx
mov    %rcx,0x40(%rax)
xor    %eax,%eax
ret
xorps  %xmm0,%xmm0
test   %rax,%rax
jne    1130 <ls_cost_nm2_f0+0x30>
jmp    1135 <ls_cost_nm2_f0+0x35>
xorps  %xmm0,%xmm0
test   %rax,%rax
jne    1148 <ls_cost_nm2_f0+0x48>
jmp    114d <ls_cost_nm2_f0+0x4d>
xorps  %xmm0,%xmm0
test   %rax,%rax
jne    1160 <ls_cost_nm2_f0+0x60>
jmp    1165 <ls_cost_nm2_f0+0x65>
xorps  %xmm0,%xmm0
test   %rax,%rax
jne    1178 <ls_cost_nm2_f0+0x78>
jmp    117d <ls_cost_nm2_f0+0x7d>
xorps  %xmm0,%xmm0
test   %rax,%rax
jne    1190 <ls_cost_nm2_f0+0x90>
jmp    1195 <ls_cost_nm2_f0+0x95>
xorps  %xmm0,%xmm0
test   %rax,%rax
jne    11ab <ls_cost_nm2_f0+0xab>
jmp    11b0 <ls_cost_nm2_f0+0xb0>
xorps  %xmm0,%xmm0
test   %rax,%rax
jne    11c3 <ls_cost_nm2_f0+0xc3>
jmp    11c8 <ls_cost_nm2_f0+0xc8>
xorps  %xmm0,%xmm0
test   %rax,%rax
jne    11db <ls_cost_nm2_f0+0xdb>
jmp    11e0 <ls_cost_nm2_f0+0xe0>

LLVM IR (-O0):
define i32 @ls_cost_nm2_f0(double** %0, double** %1, i32* %2, double* %3, i32 %4) {
%6 = alloca double**
%7 = alloca double**
%8 = alloca i32*
%9 = alloca double*
%10 = alloca i32
%11 = alloca double
store double** %0, double*** %6
store double** %1, double*** %7
store i32* %2, i32** %8
store double* %3, double** %9
store i32 %4, i32* %10
%12 = load double**, double*** %6
%13 = getelementptr inbounds double*, double** %12, i64 0
%14 = load double*, double** %13
%15 = icmp ne double* %14, null
br i1 %15, label %16, label %22
16: ; preds = %5
%17 = load double**, double*** %6
%18 = getelementptr inbounds double*, double** %17, i64 0
%19 = load double*, double** %18
%20 = getelementptr inbounds double, double* %19, i64 0
%21 = load double, double* %20
br label %23
22: ; preds = %5
br label %23
23: ; preds = %22, %16
%24 = phi double [ %21, %16 ], [ 0.000000e+00, %22 ]
store double %24, double* %11
%25 = load double**, double*** %7
%26 = getelementptr inbounds double*, double** %25, i64 0
%27 = load double*, double** %26
%28 = icmp ne double* %27, null
br i1 %28, label %29, label %35
29: ; preds = %23
%30 = load double, double* %11
%31 = load double**, double*** %7
%32 = getelementptr inbounds double*, double** %31, i64 0
%33 = load double*, double** %32
%34 = getelementptr inbounds double, double* %33, i64 0
store double %30, double* %34
br label %35
35: ; preds = %29, %23
%36 = load double**, double*** %6
%37 = getelementptr inbounds double*, double** %36, i64 0
%38 = load double*, double** %37
%39 = icmp ne double* %38, null
br i1 %39, label %40, label %46
40: ; preds = %35
%41 = load double**, double*** %6
%42 = getelementptr inbounds double*, double** %41, i64 0
%43 = load double*, double** %42
%44 = getelementptr inbounds double, double* %43, i64 1
%45 = load double, double* %44
br label %47
46: ; preds = %35
br label %47
47: ; preds = %46, %40
%48 = phi double [ %45, %40 ], [ 0.000000e+00, %46 ]
store double %48, double* %11
%49 = load double**, double*** %7
%50 = getelementptr inbounds double*, double** %49, i64 0
%51 = load double*, double** %50
%52 = icmp ne double* %51, null
br i1 %52, label %53, label %59
53: ; preds = %47
%54 = load double, double* %11
%55 = load double**, double*** %7
%56 = getelementptr inbounds double*, double** %55, i64 0
%57 = load double*, double** %56
%58 = getelementptr inbounds double, double* %57, i64 1
store double %54, double* %58
br label %59
59: ; preds = %53, %47
%60 = load double**, double*** %6
%61 = getelementptr inbounds double*, double** %60, i64 0
%62 = load double*, double** %61
%63 = icmp ne double* %62, null
br i1 %63, label %64, label %70
64: ; preds = %59
%65 = load double**, double*** %6
%66 = getelementptr inbounds double*, double** %65, i64 0
%67 = load double*, double** %66
%68 = getelementptr inbounds double, double* %67, i64 2
%69 = load double, double* %68
br label %71
70: ; preds = %59
br label %71
71: ; preds = %70, %64
%72 = phi double [ %69, %64 ], [ 0.000000e+00, %70 ]
store double %72, double* %11
%73 = load double**, double*** %7
%74 = getelementptr inbounds double*, double** %73, i64 0
%75 = load double*, double** %74
%76 = icmp ne double* %75, null
br i1 %76, label %77, label %83
77: ; preds = %71
%78 = load double, double* %11
%79 = load double**, double*** %7
%80 = getelementptr inbounds double*, double** %79, i64 0
%81 = load double*, double** %80
%82 = getelementptr inbounds double, double* %81, i64 2
store double %78, double* %82
br label %83
83: ; preds = %77, %71
%84 = load double**, double*** %6
%85 = getelementptr inbounds double*, double** %84, i64 0
%86 = load double*, double** %85
%87 = icmp ne double* %86, null
br i1 %87, label %88, label %94
88: ; preds = %83
%89 = load double**, double*** %6
%90 = getelementptr inbounds double*, double** %89, i64 0
%91 = load double*, double** %90
%92 = getelementptr inbounds double, double* %91, i64 3
%93 = load double, double* %92
br label %95
94: ; preds = %83
br label %95
95: ; preds = %94, %88
%96 = phi double [ %93, %88 ], [ 0.000000e+00, %94 ]
store double %96, double* %11
%97 = load double**, double*** %7
%98 = getelementptr inbounds double*, double** %97, i64 0
%99 = load double*, double** %98
%100 = icmp ne double* %99, null
br i1 %100, label %101, label %107
101: ; preds = %95
%102 = load double, double* %11
%103 = load double**, double*** %7
%104 = getelementptr inbounds double*, double** %103, i64 0
%105 = load double*, double** %104
%106 = getelementptr inbounds double, double* %105, i64 3
store double %102, double* %106
br label %107
107: ; preds = %101, %95
%108 = load double**, double*** %6
%109 = getelementptr inbounds double*, double** %108, i64 0
%110 = load double*, double** %109
%111 = icmp ne double* %110, null
br i1 %111, label %112, label %118
112: ; preds = %107
%113 = load double**, double*** %6
%114 = getelementptr inbounds double*, double** %113, i64 0
%115 = load double*, double** %114
%116 = getelementptr inbounds double, double* %115, i64 4
%117 = load double, double* %116
br label %119
118: ; preds = %107
br label %119
119: ; preds = %118, %112
%120 = phi double [ %117, %112 ], [ 0.000000e+00, %118 ]
store double %120, double* %11
%121 = load double**, double*** %7
%122 = getelementptr inbounds double*, double** %121, i64 0
%123 = load double*, double** %122
%124 = icmp ne double* %123, null
br i1 %124, label %125, label %131
125: ; preds = %119
%126 = load double, double* %11
%127 = load double**, double*** %7
%128 = getelementptr inbounds double*, double** %127, i64 0
%129 = load double*, double** %128
%130 = getelementptr inbounds double, double* %129, i64 4
store double %126, double* %130
br label %131
131: ; preds = %125, %119
%132 = load double**, double*** %6
%133 = getelementptr inbounds double*, double** %132, i64 0
%134 = load double*, double** %133
%135 = icmp ne double* %134, null
br i1 %135, label %136, label %142
136: ; preds = %131
%137 = load double**, double*** %6
%138 = getelementptr inbounds double*, double** %137, i64 0
%139 = load double*, double** %138
%140 = getelementptr inbounds double, double* %139, i64 5
%141 = load double, double* %140
br label %143
142: ; preds = %131
br label %143
143: ; preds = %142, %136
%144 = phi double [ %141, %136 ], [ 0.000000e+00, %142 ]
store double %144, double* %11
%145 = load double**, double*** %7
%146 = getelementptr inbounds double*, double** %145, i64 0
%147 = load double*, double** %146
%148 = icmp ne double* %147, null
br i1 %148, label %149, label %155
149: ; preds = %143
%150 = load double, double* %11
%151 = load double**, double*** %7
%152 = getelementptr inbounds double*, double** %151, i64 0
%153 = load double*, double** %152
%154 = getelementptr inbounds double, double* %153, i64 5
store double %150, double* %154
br label %155
155: ; preds = %149, %143
%156 = load double**, double*** %6
%157 = getelementptr inbounds double*, double** %156, i64 1
%158 = load double*, double** %157
%159 = icmp ne double* %158, null
br i1 %159, label %160, label %166
160: ; preds = %155
%161 = load double**, double*** %6
%162 = getelementptr inbounds double*, double** %161, i64 1
%163 = load double*, double** %162
%164 = getelementptr inbounds double, double* %163, i64 0
%165 = load double, double* %164
br label %167
166: ; preds = %155
br label %167
167: ; preds = %166, %160
%168 = phi double [ %165, %160 ], [ 0.000000e+00, %166 ]
store double %168, double* %11
%169 = load double**, double*** %7
%170 = getelementptr inbounds double*, double** %169, i64 0
%171 = load double*, double** %170
%172 = icmp ne double* %171, null
br i1 %172, label %173, label %179
173: ; preds = %167
%174 = load double, double* %11
%175 = load double**, double*** %7
%176 = getelementptr inbounds double*, double** %175, i64 0
%177 = load double*, double** %176
%178 = getelementptr inbounds double, double* %177, i64 6
store double %174, double* %178
br label %179
179: ; preds = %173, %167
%180 = load double**, double*** %6
%181 = getelementptr inbounds double*, double** %180, i64 1
%182 = load double*, double** %181
%183 = icmp ne double* %182, null
br i1 %183, label %184, label %190
184: ; preds = %179
%185 = load double**, double*** %6
%186 = getelementptr inbounds double*, double** %185, i64 1
%187 = load double*, double** %186
%188 = getelementptr inbounds double, double* %187, i64 1
%189 = load double, double* %188
br label %191
190: ; preds = %179
br label %191
191: ; preds = %190, %184
%192 = phi double [ %189, %184 ], [ 0.000000e+00, %190 ]
store double %192, double* %11
%193 = load double**, double*** %7
%194 = getelementptr inbounds double*, double** %193, i64 0
%195 = load double*, double** %194
%196 = icmp ne double* %195, null
br i1 %196, label %197, label %203
197: ; preds = %191
%198 = load double, double* %11
%199 = load double**, double*** %7
%200 = getelementptr inbounds double*, double** %199, i64 0
%201 = load double*, double** %200
%202 = getelementptr inbounds double, double* %201, i64 7
store double %198, double* %202
br label %203
203: ; preds = %197, %191
%204 = load double**, double*** %6
%205 = getelementptr inbounds double*, double** %204, i64 1
%206 = load double*, double** %205
%207 = icmp ne double* %206, null
br i1 %207, label %208, label %214
208: ; preds = %203
%209 = load double**, double*** %6
%210 = getelementptr inbounds double*, double** %209, i64 1
%211 = load double*, double** %210
%212 = getelementptr inbounds double, double* %211, i64 2
%213 = load double, double* %212
br label %215
214: ; preds = %203
br label %215
215: ; preds = %214, %208
%216 = phi double [ %213, %208 ], [ 0.000000e+00, %214 ]
store double %216, double* %11
%217 = load double**, double*** %7
%218 = getelementptr inbounds double*, double** %217, i64 0
%219 = load double*, double** %218
%220 = icmp ne double* %219, null
br i1 %220, label %221, label %227
221: ; preds = %215
%222 = load double, double* %11
%223 = load double**, double*** %7
%224 = getelementptr inbounds double*, double** %223, i64 0
%225 = load double*, double** %224
%226 = getelementptr inbounds double, double* %225, i64 8
store double %222, double* %226
br label %227
227: ; preds = %221, %215
store double 1.000000e+00, double* %11
%228 = load double**, double*** %7
%229 = getelementptr inbounds double*, double** %228, i64 1
%230 = load double*, double** %229
%231 = icmp ne double* %230, null
br i1 %231, label %232, label %238
232: ; preds = %227
%233 = load double, double* %11
%234 = load double**, double*** %7
%235 = getelementptr inbounds double*, double** %234, i64 1
%236 = load double*, double** %235
%237 = getelementptr inbounds double, double* %236, i64 0
store double %233, double* %237
br label %238
238: ; preds = %232, %227
%239 = load double**, double*** %7
%240 = getelementptr inbounds double*, double** %239, i64 1
%241 = load double*, double** %240
%242 = icmp ne double* %241, null
br i1 %242, label %243, label %249
243: ; preds = %238
%244 = load double, double* %11
%245 = load double**, double*** %7
%246 = getelementptr inbounds double*, double** %245, i64 1
%247 = load double*, double** %246
%248 = getelementptr inbounds double, double* %247, i64 1
store double %244, double* %248
br label %249
249: ; preds = %243, %238
%250 = load double**, double*** %7
%251 = getelementptr inbounds double*, double** %250, i64 1
%252 = load double*, double** %251
%253 = icmp ne double* %252, null
br i1 %253, label %254, label %260
254: ; preds = %249
%255 = load double, double* %11
%256 = load double**, double*** %7
%257 = getelementptr inbounds double*, double** %256, i64 1
%258 = load double*, double** %257
%259 = getelementptr inbounds double, double* %258, i64 2
store double %255, double* %259
br label %260
260: ; preds = %254, %249
%261 = load double**, double*** %7
%262 = getelementptr inbounds double*, double** %261, i64 1
%263 = load double*, double** %262
%264 = icmp ne double* %263, null
br i1 %264, label %265, label %271
265: ; preds = %260
%266 = load double, double* %11
%267 = load double**, double*** %7
%268 = getelementptr inbounds double*, double** %267, i64 1
%269 = load double*, double** %268
%270 = getelementptr inbounds double, double* %269, i64 3
store double %266, double* %270
br label %271
271: ; preds = %265, %260
%272 = load double**, double*** %7
%273 = getelementptr inbounds double*, double** %272, i64 1
%274 = load double*, double** %273
%275 = icmp ne double* %274, null
br i1 %275, label %276, label %282
276: ; preds = %271
%277 = load double, double* %11
%278 = load double**, double*** %7
%279 = getelementptr inbounds double*, double** %278, i64 1
%280 = load double*, double** %279
%281 = getelementptr inbounds double, double* %280, i64 4
store double %277, double* %281
br label %282
282: ; preds = %276, %271
%283 = load double**, double*** %7
%284 = getelementptr inbounds double*, double** %283, i64 1
%285 = load double*, double** %284
%286 = icmp ne double* %285, null
br i1 %286, label %287, label %293
287: ; preds = %282
%288 = load double, double* %11
%289 = load double**, double*** %7
%290 = getelementptr inbounds double*, double** %289, i64 1
%291 = load double*, double** %290
%292 = getelementptr inbounds double, double* %291, i64 5
store double %288, double* %292
br label %293
293: ; preds = %287, %282
%294 = load double**, double*** %7
%295 = getelementptr inbounds double*, double** %294, i64 1
%296 = load double*, double** %295
%297 = icmp ne double* %296, null
br i1 %297, label %298, label %304
298: ; preds = %293
%299 = load double, double* %11
%300 = load double**, double*** %7
%301 = getelementptr inbounds double*, double** %300, i64 1
%302 = load double*, double** %301
%303 = getelementptr inbounds double, double* %302, i64 6
store double %299, double* %303
br label %304
304: ; preds = %298, %293
%305 = load double**, double*** %7
%306 = getelementptr inbounds double*, double** %305, i64 1
%307 = load double*, double** %306
%308 = icmp ne double* %307, null
br i1 %308, label %309, label %315
309: ; preds = %304
%310 = load double, double* %11
%311 = load double**, double*** %7
%312 = getelementptr inbounds double*, double** %311, i64 1
%313 = load double*, double** %312
%314 = getelementptr inbounds double, double* %313, i64 7
store double %310, double* %314
br label %315
315: ; preds = %309, %304
%316 = load double**, double*** %7
%317 = getelementptr inbounds double*, double** %316, i64 1
%318 = load double*, double** %317
%319 = icmp ne double* %318, null
br i1 %319, label %320, label %326
320: ; preds = %315
%321 = load double, double* %11
%322 = load double**, double*** %7
%323 = getelementptr inbounds double*, double** %322, i64 1
%324 = load double*, double** %323
%325 = getelementptr inbounds double, double* %324, i64 8
store double %321, double* %325
br label %326
326: ; preds = %320, %315
ret i32 0
}

LLVM IR (-O2):
define i32 @ls_cost_nm2_f0(double** nocapture %0, double** nocapture %1, i32* nocapture readnone %2, double* nocapture readnone %3, i32 %4) {
%6 = load double*, double** %0
%7 = icmp eq double* %6, null
br i1 %7, label %10, label %8
8: ; preds = %5
%9 = load double, double* %6
br label %10
10: ; preds = %5, %8
%11 = phi double [ %9, %8 ], [ 0.000000e+00, %5 ]
%12 = load double*, double** %1
%13 = icmp eq double* %12, null
br i1 %13, label %15, label %14
14: ; preds = %10
store double %11, double* %12
br label %15
15: ; preds = %14, %10
br i1 %7, label %19, label %16
16: ; preds = %15
%17 = getelementptr inbounds double, double* %6, i64 1
%18 = load double, double* %17
br label %19
19: ; preds = %15, %16
%20 = phi double [ %18, %16 ], [ 0.000000e+00, %15 ]
br i1 %13, label %23, label %21
21: ; preds = %19
%22 = getelementptr inbounds double, double* %12, i64 1
store double %20, double* %22
br label %23
23: ; preds = %21, %19
br i1 %7, label %27, label %24
24: ; preds = %23
%25 = getelementptr inbounds double, double* %6, i64 2
%26 = load double, double* %25
br label %27
27: ; preds = %23, %24
%28 = phi double [ %26, %24 ], [ 0.000000e+00, %23 ]
br i1 %13, label %31, label %29
29: ; preds = %27
%30 = getelementptr inbounds double, double* %12, i64 2
store double %28, double* %30
br label %31
31: ; preds = %29, %27
br i1 %7, label %35, label %32
32: ; preds = %31
%33 = getelementptr inbounds double, double* %6, i64 3
%34 = load double, double* %33
br label %35
35: ; preds = %31, %32
%36 = phi double [ %34, %32 ], [ 0.000000e+00, %31 ]
br i1 %13, label %39, label %37
37: ; preds = %35
%38 = getelementptr inbounds double, double* %12, i64 3
store double %36, double* %38
br label %39
39: ; preds = %37, %35
br i1 %7, label %43, label %40
40: ; preds = %39
%41 = getelementptr inbounds double, double* %6, i64 4
%42 = load double, double* %41
br label %43
43: ; preds = %39, %40
%44 = phi double [ %42, %40 ], [ 0.000000e+00, %39 ]
br i1 %13, label %47, label %45
45: ; preds = %43
%46 = getelementptr inbounds double, double* %12, i64 4
store double %44, double* %46
br label %47
47: ; preds = %45, %43
br i1 %7, label %51, label %48
48: ; preds = %47
%49 = getelementptr inbounds double, double* %6, i64 5
%50 = load double, double* %49
br label %51
51: ; preds = %47, %48
%52 = phi double [ %50, %48 ], [ 0.000000e+00, %47 ]
br i1 %13, label %55, label %53
53: ; preds = %51
%54 = getelementptr inbounds double, double* %12, i64 5
store double %52, double* %54
br label %55
55: ; preds = %53, %51
%56 = getelementptr inbounds double*, double** %0, i64 1
%57 = load double*, double** %56
%58 = icmp eq double* %57, null
br i1 %58, label %61, label %59
59: ; preds = %55
%60 = load double, double* %57
br label %61
61: ; preds = %55, %59
%62 = phi double [ %60, %59 ], [ 0.000000e+00, %55 ]
br i1 %13, label %65, label %63
63: ; preds = %61
%64 = getelementptr inbounds double, double* %12, i64 6
store double %62, double* %64
br label %65
65: ; preds = %63, %61
br i1 %58, label %69, label %66
66: ; preds = %65
%67 = getelementptr inbounds double, double* %57, i64 1
%68 = load double, double* %67
br label %69
69: ; preds = %65, %66
%70 = phi double [ %68, %66 ], [ 0.000000e+00, %65 ]
br i1 %13, label %73, label %71
71: ; preds = %69
%72 = getelementptr inbounds double, double* %12, i64 7
store double %70, double* %72
br label %73
73: ; preds = %71, %69
br i1 %58, label %77, label %74
74: ; preds = %73
%75 = getelementptr inbounds double, double* %57, i64 2
%76 = load double, double* %75
br label %77
77: ; preds = %73, %74
%78 = phi double [ %76, %74 ], [ 0.000000e+00, %73 ]
br i1 %13, label %81, label %79
79: ; preds = %77
%80 = getelementptr inbounds double, double* %12, i64 8
store double %78, double* %80
br label %81
81: ; preds = %79, %77
%82 = getelementptr inbounds double*, double** %1, i64 1
%83 = load double*, double** %82
%84 = icmp eq double* %83, null
br i1 %84, label %94, label %85
85: ; preds = %81
%86 = bitcast double* %83 to <2 x double>*
store <2 x double> <double 1.000000e+00, double 1.000000e+00>, <2 x double>* %86
%87 = getelementptr inbounds double, double* %83, i64 2
%88 = bitcast double* %87 to <2 x double>*
store <2 x double> <double 1.000000e+00, double 1.000000e+00>, <2 x double>* %88
%89 = getelementptr inbounds double, double* %83, i64 4
%90 = bitcast double* %89 to <2 x double>*
store <2 x double> <double 1.000000e+00, double 1.000000e+00>, <2 x double>* %90
%91 = getelementptr inbounds double, double* %83, i64 6
%92 = bitcast double* %91 to <2 x double>*
store <2 x double> <double 1.000000e+00, double 1.000000e+00>, <2 x double>* %92
%93 = getelementptr inbounds double, double* %83, i64 8
store double 1.000000e+00, double* %93
br label %94
94: ; preds = %81, %85
ret i32 0
}