#include <stdbool.h>
#include <stdio.h>
int c[100];

int length(int i, int j) {
    return c[10 * i + j];
}

typedef struct Node {
    int number;
    bool done;
    int cost;
} Node;

int main() {
    int h, w;
    scanf("%d %d", &h, &w);
    for (int i = 0; i < 100; i++) scanf("%d", c + i);

    int costs[10] = {0};

    for (int j = 0; j < 10; j++) {
        if (j == 1) continue;
        Node nodes[10];
        for (int i = 0; i < 10; i++) {
            Node node = {.number = i, .done = false, .cost = -1};
            nodes[i] = node;
        }

        nodes[j].cost = 0;

        while (true) {
            Node doneNode = {.number = -1, .done = false, .cost = -1};
            for (int i = 0; i < 10; i++) {
                Node node = nodes[i];
                if (node.done || node.cost < 0) {
                    continue;
                }
                if (doneNode.number == -1 || node.cost < doneNode.cost) {
                    doneNode = node;
                }
            }
            if (doneNode.number == -1) {
                break;
            }
            nodes[doneNode.number].done = true;
            for (int i = 0; i < 10; i++) {
                if (doneNode.number == i) continue;
                int cost = doneNode.cost + length(doneNode.number, i);
                if (nodes[i].cost < 0 || cost < nodes[i].cost) {
                    nodes[i].cost = cost;
                }
            }
        }

        costs[j] = nodes[1].cost;
    }

    int ans = 0;
    for (int i = 0; i < h * w; i++) {
        int a;
        scanf("%d", &a);
        if (a != -1) ans += costs[a];
    }
    printf("%d\n", ans);
}

; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/ObjectiveC/Source_676/source.m'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/ObjectiveC/Source_676/source.m"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"

%struct.Node = type { i32, i8, i32 }

@c = dso_local global [100 x i32] zeroinitializer, align 16
@.str = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1
@.str.1 = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.2 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1

; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(read, argmem: none, inaccessiblemem: none) uwtable
define dso_local i32 @length(i32 noundef %i, i32 noundef %j) local_unnamed_addr #0 {
entry:
  %mul = mul nsw i32 %i, 10
  %add = add nsw i32 %mul, %j
  %idxprom = sext i32 %add to i64
  %arrayidx = getelementptr inbounds [100 x i32], ptr @c, i64 0, i64 %idxprom
  %0 = load i32, ptr %arrayidx, align 4, !tbaa !5
  ret i32 %0
}

; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #1 {
entry:
  %h = alloca i32, align 4
  %w = alloca i32, align 4
  %costs = alloca [10 x i32], align 16
  %nodes = alloca [10 x %struct.Node], align 16
  %a = alloca i32, align 4
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %h) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %w) #5
  %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %h, ptr noundef nonnull %w)
  br label %for.body

for.cond.cleanup:                                 ; preds = %for.body
  call void @llvm.lifetime.start.p0(i64 40, ptr nonnull %costs) #5
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(40) %costs, i8 0, i64 40, i1 false)
  %cost86 = getelementptr inbounds [10 x %struct.Node], ptr %nodes, i64 0, i64 1, i32 2
  %node.sroa.4.0.arrayidx.sroa_idx = getelementptr inbounds i8, ptr %nodes, i64 4
  %node.sroa.5131.0.arrayidx.sroa_idx = getelementptr inbounds i8, ptr %nodes, i64 8
  %arrayidx.1 = getelementptr inbounds [10 x %struct.Node], ptr %nodes, i64 0, i64 1
  %node.sroa.4.0.arrayidx.sroa_idx.1 = getelementptr inbounds [10 x %struct.Node], ptr %nodes, i64 0, i64 1, i32 1
  %node.sroa.5131.0.arrayidx.sroa_idx.1 = getelementptr inbounds [10 x %struct.Node], ptr %nodes, i64 0, i64 1, i32 2
  %arrayidx.2 = getelementptr inbounds [10 x %struct.Node], ptr %nodes, i64 0, i64 2
  %node.sroa.4.0.arrayidx.sroa_idx.2 = getelementptr inbounds [10 x %struct.Node], ptr %nodes, i64 0, i64 2, i32 1
  %node.sroa.5131.0.arrayidx.sroa_idx.2 = getelementptr inbounds [10 x %struct.Node], ptr %nodes, i64 0, i64 2, i32 2
  %arrayidx.3 = getelementptr inbounds [10 x %struct.Node], ptr %nodes, i64 0, i64 3
  %node.sroa.4.0.arrayidx.sroa_idx.3 = getelementptr inbounds [10 x %struct.Node], ptr %nodes, i64 0, i64 3, i32 1
  %node.sroa.5131.0.arrayidx.sroa_idx.3 = getelementptr inbounds [10 x %struct.Node], ptr %nodes, i64 0, i64 3, i32 2
  %arrayidx.4 = getelementptr inbounds [10 x %struct.Node], ptr %nodes, i64 0, i64 4
  %node.sroa.4.0.arrayidx.sroa_idx.4 = getelementptr inbounds [10 x %struct.Node], ptr %nodes, i64 0, i64 4, i32 1
  %node.sroa.5131.0.arrayidx.sroa_idx.4 = getelementptr inbounds [10 x %struct.Node], ptr %nodes, i64 0, i64 4, i32 2
  %arrayidx.5 = getelementptr inbounds [10 x %struct.Node], ptr %nodes, i64 0, i64 5
  %node.sroa.4.0.arrayidx.sroa_idx.5 = getelementptr inbounds [10 x %struct.Node], ptr %nodes, i64 0, i64 5, i32 1
  %node.sroa.5131.0.arrayidx.sroa_idx.5 = getelementptr inbounds [10 x %struct.Node], ptr %nodes, i64 0, i64 5, i32 2
  %arrayidx.6 = getelementptr inbounds [10 x %struct.Node], ptr %nodes, i64 0, i64 6
  %node.sroa.4.0.arrayidx.sroa_idx.6 = getelementptr inbounds [10 x %struct.Node], ptr %nodes, i64 0, i64 6, i32 1
  %node.sroa.5131.0.arrayidx.sroa_idx.6 = getelementptr inbounds [10 x %struct.Node], ptr %nodes, i64 0, i64 6, i32 2
  %arrayidx.7 = getelementptr inbounds [10 x %struct.Node], ptr %nodes, i64 0, i64 7
  %node.sroa.4.0.arrayidx.sroa_idx.7 = getelementptr inbounds [10 x %struct.Node], ptr %nodes, i64 0, i64 7, i32 1
  %node.sroa.5131.0.arrayidx.sroa_idx.7 = getelementptr inbounds [10 x %struct.Node], ptr %nodes, i64 0, i64 7, i32 2
  %arrayidx.8 = getelementptr inbounds [10 x %struct.Node], ptr %nodes, i64 0, i64 8
  %node.sroa.4.0.arrayidx.sroa_idx.8 = getelementptr inbounds [10 x %struct.Node], ptr %nodes, i64 0, i64 8, i32 1
  %node.sroa.5131.0.arrayidx.sroa_idx.8 = getelementptr inbounds [10 x %struct.Node], ptr %nodes, i64 0, i64 8, i32 2
  %arrayidx.9 = getelementptr inbounds [10 x %struct.Node], ptr %nodes, i64 0, i64 9
  %node.sroa.4.0.arrayidx.sroa_idx.9 = getelementptr inbounds [10 x %struct.Node], ptr %nodes, i64 0, i64 9, i32 1
  %node.sroa.5131.0.arrayidx.sroa_idx.9 = getelementptr inbounds [10 x %struct.Node], ptr %nodes, i64 0, i64 9, i32 2
  %done50222 = getelementptr inbounds [10 x %struct.Node], ptr %nodes, i64 0, i64 9, i32 1
  %cost66.2 = getelementptr inbounds [10 x %struct.Node], ptr %nodes, i64 0, i64 2, i32 2
  %cost66.3 = getelementptr inbounds [10 x %struct.Node], ptr %nodes, i64 0, i64 3, i32 2
  %cost66.4 = getelementptr inbounds [10 x %struct.Node], ptr %nodes, i64 0, i64 4, i32 2
  %cost66.5 = getelementptr inbounds [10 x %struct.Node], ptr %nodes, i64 0, i64 5, i32 2
  %cost66.6 = getelementptr inbounds [10 x %struct.Node], ptr %nodes, i64 0, i64 6, i32 2
  %cost66.7 = getelementptr inbounds [10 x %struct.Node], ptr %nodes, i64 0, i64 7, i32 2
  %cost66.8 = getelementptr inbounds [10 x %struct.Node], ptr %nodes, i64 0, i64 8, i32 2
  %cost66.9 = getelementptr inbounds [10 x %struct.Node], ptr %nodes, i64 0, i64 9, i32 2
  br label %for.body5

for.body:                                         ; preds = %entry, %for.body
  %indvars.iv = phi i64 [ 0, %entry ], [ %indvars.iv.next, %for.body ]
  %add.ptr = getelementptr inbounds i32, ptr @c, i64 %indvars.iv
  %call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %add.ptr)
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next, 100
  br i1 %exitcond.not, label %for.cond.cleanup, label %for.body

for.cond94.preheader:                             ; preds = %for.inc89
  %0 = load i32, ptr %h, align 4, !tbaa !5
  %1 = load i32, ptr %w, align 4, !tbaa !5
  %mul153 = mul nsw i32 %1, %0
  %cmp95154 = icmp sgt i32 %mul153, 0
  br i1 %cmp95154, label %for.body97, label %for.cond.cleanup96

for.body5:                                        ; preds = %for.cond.cleanup, %for.inc89
  %indvars.iv171 = phi i64 [ 0, %for.cond.cleanup ], [ %indvars.iv.next172, %for.inc89 ]
  %cmp6 = icmp eq i64 %indvars.iv171, 1
  br i1 %cmp6, label %for.inc89, label %if.end

if.end:                                           ; preds = %for.body5
  call void @llvm.lifetime.start.p0(i64 120, ptr nonnull %nodes) #5
  store i32 0, ptr %nodes, align 16, !tbaa.struct !9
  store i8 0, ptr %node.sroa.4.0.arrayidx.sroa_idx, align 4, !tbaa.struct !12
  store i32 -1, ptr %node.sroa.5131.0.arrayidx.sroa_idx, align 8, !tbaa.struct !13
  store i32 1, ptr %arrayidx.1, align 4, !tbaa.struct !9
  store i8 0, ptr %node.sroa.4.0.arrayidx.sroa_idx.1, align 16, !tbaa.struct !12
  store i32 -1, ptr %node.sroa.5131.0.arrayidx.sroa_idx.1, align 4, !tbaa.struct !13
  store i32 2, ptr %arrayidx.2, align 8, !tbaa.struct !9
  store i8 0, ptr %node.sroa.4.0.arrayidx.sroa_idx.2, align 4, !tbaa.struct !12
  store i32 -1, ptr %node.sroa.5131.0.arrayidx.sroa_idx.2, align 16, !tbaa.struct !13
  store i32 3, ptr %arrayidx.3, align 4, !tbaa.struct !9
  store i8 0, ptr %node.sroa.4.0.arrayidx.sroa_idx.3, align 8, !tbaa.struct !12
  store i32 -1, ptr %node.sroa.5131.0.arrayidx.sroa_idx.3, align 4, !tbaa.struct !13
  store i32 4, ptr %arrayidx.4, align 16, !tbaa.struct !9
  store i8 0, ptr %node.sroa.4.0.arrayidx.sroa_idx.4, align 4, !tbaa.struct !12
  store i32 -1, ptr %node.sroa.5131.0.arrayidx.sroa_idx.4, align 8, !tbaa.struct !13
  store i32 5, ptr %arrayidx.5, align 4, !tbaa.struct !9
  store i8 0, ptr %node.sroa.4.0.arrayidx.sroa_idx.5, align 16, !tbaa.struct !12
  store i32 -1, ptr %node.sroa.5131.0.arrayidx.sroa_idx.5, align 4, !tbaa.struct !13
  store i32 6, ptr %arrayidx.6, align 8, !tbaa.struct !9
  store i8 0, ptr %node.sroa.4.0.arrayidx.sroa_idx.6, align 4, !tbaa.struct !12
  store i32 -1, ptr %node.sroa.5131.0.arrayidx.sroa_idx.6, align 16, !tbaa.struct !13
  store i32 7, ptr %arrayidx.7, align 4, !tbaa.struct !9
  store i8 0, ptr %node.sroa.4.0.arrayidx.sroa_idx.7, align 8, !tbaa.struct !12
  store i32 -1, ptr %node.sroa.5131.0.arrayidx.sroa_idx.7, align 4, !tbaa.struct !13
  store i32 8, ptr %arrayidx.8, align 16, !tbaa.struct !9
  store i8 0, ptr %node.sroa.4.0.arrayidx.sroa_idx.8, align 4, !tbaa.struct !12
  store i32 -1, ptr %node.sroa.5131.0.arrayidx.sroa_idx.8, align 8, !tbaa.struct !13
  store i32 9, ptr %arrayidx.9, align 4, !tbaa.struct !9
  store i8 0, ptr %node.sroa.4.0.arrayidx.sroa_idx.9, align 16, !tbaa.struct !12
  store i32 -1, ptr %node.sroa.5131.0.arrayidx.sroa_idx.9, align 4, !tbaa.struct !13
  %cost17 = getelementptr inbounds [10 x %struct.Node], ptr %nodes, i64 0, i64 %indvars.iv171, i32 2
  store i32 0, ptr %cost17, align 4, !tbaa !14
  %node23.sroa.5121.0.copyload.pre = load i32, ptr %node.sroa.5131.0.arrayidx.sroa_idx, align 8
  %node23.sroa.0.0.copyload = load i32, ptr %nodes, align 16
  %node.sroa.5131.0.arrayidx.sroa_idx.1.promoted = load i32, ptr %node.sroa.5131.0.arrayidx.sroa_idx.1, align 4
  %node.sroa.5131.0.arrayidx.sroa_idx.2.promoted = load i32, ptr %node.sroa.5131.0.arrayidx.sroa_idx.2, align 16
  %node.sroa.5131.0.arrayidx.sroa_idx.3.promoted = load i32, ptr %node.sroa.5131.0.arrayidx.sroa_idx.3, align 4
  %node.sroa.5131.0.arrayidx.sroa_idx.4.promoted = load i32, ptr %node.sroa.5131.0.arrayidx.sroa_idx.4, align 8
  %node.sroa.5131.0.arrayidx.sroa_idx.5.promoted = load i32, ptr %node.sroa.5131.0.arrayidx.sroa_idx.5, align 4
  %node.sroa.5131.0.arrayidx.sroa_idx.6.promoted = load i32, ptr %node.sroa.5131.0.arrayidx.sroa_idx.6, align 16
  %node.sroa.5131.0.arrayidx.sroa_idx.7.promoted = load i32, ptr %node.sroa.5131.0.arrayidx.sroa_idx.7, align 4
  %node.sroa.5131.0.arrayidx.sroa_idx.8.promoted = load i32, ptr %node.sroa.5131.0.arrayidx.sroa_idx.8, align 8
  %node.sroa.5131.0.arrayidx.sroa_idx.9.promoted = load i32, ptr %node.sroa.5131.0.arrayidx.sroa_idx.9, align 4
  br label %while.cond

while.cond:                                       ; preds = %for.inc78.9, %if.end
  %node23.sroa.5121.0.copyload.9297 = phi i32 [ %node23.sroa.5121.0.copyload.9296, %for.inc78.9 ], [ %node.sroa.5131.0.arrayidx.sroa_idx.9.promoted, %if.end ]
  %node23.sroa.5121.0.copyload.8295 = phi i32 [ %node23.sroa.5121.0.copyload.8293, %for.inc78.9 ], [ %node.sroa.5131.0.arrayidx.sroa_idx.8.promoted, %if.end ]
  %node23.sroa.5121.0.copyload.7292 = phi i32 [ %node23.sroa.5121.0.copyload.7290, %for.inc78.9 ], [ %node.sroa.5131.0.arrayidx.sroa_idx.7.promoted, %if.end ]
  %node23.sroa.5121.0.copyload.6288 = phi i32 [ %node23.sroa.5121.0.copyload.6284, %for.inc78.9 ], [ %node.sroa.5131.0.arrayidx.sroa_idx.6.promoted, %if.end ]
  %node23.sroa.5121.0.copyload.5283 = phi i32 [ %node23.sroa.5121.0.copyload.5278, %for.inc78.9 ], [ %node.sroa.5131.0.arrayidx.sroa_idx.5.promoted, %if.end ]
  %node23.sroa.5121.0.copyload.4277 = phi i32 [ %node23.sroa.5121.0.copyload.4272, %for.inc78.9 ], [ %node.sroa.5131.0.arrayidx.sroa_idx.4.promoted, %if.end ]
  %node23.sroa.5121.0.copyload.3270 = phi i32 [ %node23.sroa.5121.0.copyload.3263, %for.inc78.9 ], [ %node.sroa.5131.0.arrayidx.sroa_idx.3.promoted, %if.end ]
  %node23.sroa.5121.0.copyload.2262 = phi i32 [ %node23.sroa.5121.0.copyload.2254, %for.inc78.9 ], [ %node.sroa.5131.0.arrayidx.sroa_idx.2.promoted, %if.end ]
  %node23.sroa.5121.0.copyload.1253 = phi i32 [ %node23.sroa.5121.0.copyload.1245, %for.inc78.9 ], [ %node.sroa.5131.0.arrayidx.sroa_idx.1.promoted, %if.end ]
  %2 = phi i32 [ %node23.sroa.5121.0.copyload176186190194198202206210214218, %for.inc78.9 ], [ %node23.sroa.5121.0.copyload.pre, %if.end ]
  %node23.sroa.4.0.copyload = phi i8 [ %node23.sroa.4.0.copyload.pre, %for.inc78.9 ], [ 0, %if.end ]
  %3 = and i8 %node23.sroa.4.0.copyload, 1
  %tobool = icmp ne i8 %3, 0
  %cmp28 = icmp slt i32 %2, 0
  %or.cond = select i1 %tobool, i1 true, i1 %cmp28
  %spec.select = select i1 %or.cond, i32 -1, i32 %2
  %spec.select298 = select i1 %or.cond, i32 -1, i32 %node23.sroa.0.0.copyload
  %node23.sroa.4.0.copyload.1 = load i8, ptr %node.sroa.4.0.arrayidx.sroa_idx.1, align 16, !tbaa.struct !12
  %4 = and i8 %node23.sroa.4.0.copyload.1, 1
  %tobool.1 = icmp ne i8 %4, 0
  %cmp28.1 = icmp slt i32 %node23.sroa.5121.0.copyload.1253, 0
  %or.cond.1 = select i1 %tobool.1, i1 true, i1 %cmp28.1
  br i1 %or.cond.1, label %cleanup.1, label %if.end30.1

if.end30.1:                                       ; preds = %while.cond
  %cmp32.1 = icmp eq i32 %spec.select298, -1
  %cmp36.1 = icmp slt i32 %node23.sroa.5121.0.copyload.1253, %spec.select
  %or.cond142.1 = select i1 %cmp32.1, i1 true, i1 %cmp36.1
  %doneNode.sroa.11.1.1 = select i1 %or.cond142.1, i32 %node23.sroa.5121.0.copyload.1253, i32 %spec.select
  %doneNode.sroa.0.1.1 = select i1 %or.cond142.1, i32 1, i32 %spec.select298
  br label %cleanup.1

cleanup.1:                                        ; preds = %if.end30.1, %while.cond
  %doneNode.sroa.11.2.1 = phi i32 [ %doneNode.sroa.11.1.1, %if.end30.1 ], [ %spec.select, %while.cond ]
  %doneNode.sroa.0.2.1 = phi i32 [ %doneNode.sroa.0.1.1, %if.end30.1 ], [ %spec.select298, %while.cond ]
  %node23.sroa.4.0.copyload.2 = load i8, ptr %node.sroa.4.0.arrayidx.sroa_idx.2, align 4, !tbaa.struct !12
  %5 = and i8 %node23.sroa.4.0.copyload.2, 1
  %tobool.2 = icmp ne i8 %5, 0
  %cmp28.2 = icmp slt i32 %node23.sroa.5121.0.copyload.2262, 0
  %or.cond.2 = select i1 %tobool.2, i1 true, i1 %cmp28.2
  br i1 %or.cond.2, label %cleanup.2, label %if.end30.2

if.end30.2:                                       ; preds = %cleanup.1
  %cmp32.2 = icmp eq i32 %doneNode.sroa.0.2.1, -1
  %cmp36.2 = icmp slt i32 %node23.sroa.5121.0.copyload.2262, %doneNode.sroa.11.2.1
  %or.cond142.2 = select i1 %cmp32.2, i1 true, i1 %cmp36.2
  %doneNode.sroa.11.1.2 = select i1 %or.cond142.2, i32 %node23.sroa.5121.0.copyload.2262, i32 %doneNode.sroa.11.2.1
  %doneNode.sroa.0.1.2 = select i1 %or.cond142.2, i32 2, i32 %doneNode.sroa.0.2.1
  br label %cleanup.2

cleanup.2:                                        ; preds = %if.end30.2, %cleanup.1
  %doneNode.sroa.11.2.2 = phi i32 [ %doneNode.sroa.11.1.2, %if.end30.2 ], [ %doneNode.sroa.11.2.1, %cleanup.1 ]
  %doneNode.sroa.0.2.2 = phi i32 [ %doneNode.sroa.0.1.2, %if.end30.2 ], [ %doneNode.sroa.0.2.1, %cleanup.1 ]
  %node23.sroa.4.0.copyload.3 = load i8, ptr %node.sroa.4.0.arrayidx.sroa_idx.3, align 8, !tbaa.struct !12
  %6 = and i8 %node23.sroa.4.0.copyload.3, 1
  %tobool.3 = icmp ne i8 %6, 0
  %cmp28.3 = icmp slt i32 %node23.sroa.5121.0.copyload.3270, 0
  %or.cond.3 = select i1 %tobool.3, i1 true, i1 %cmp28.3
  br i1 %or.cond.3, label %cleanup.3, label %if.end30.3

if.end30.3:                                       ; preds = %cleanup.2
  %cmp32.3 = icmp eq i32 %doneNode.sroa.0.2.2, -1
  %cmp36.3 = icmp slt i32 %node23.sroa.5121.0.copyload.3270, %doneNode.sroa.11.2.2
  %or.cond142.3 = select i1 %cmp32.3, i1 true, i1 %cmp36.3
  %doneNode.sroa.11.1.3 = select i1 %or.cond142.3, i32 %node23.sroa.5121.0.copyload.3270, i32 %doneNode.sroa.11.2.2
  %doneNode.sroa.0.1.3 = select i1 %or.cond142.3, i32 3, i32 %doneNode.sroa.0.2.2
  br label %cleanup.3

cleanup.3:                                        ; preds = %if.end30.3, %cleanup.2
  %doneNode.sroa.11.2.3 = phi i32 [ %doneNode.sroa.11.1.3, %if.end30.3 ], [ %doneNode.sroa.11.2.2, %cleanup.2 ]
  %doneNode.sroa.0.2.3 = phi i32 [ %doneNode.sroa.0.1.3, %if.end30.3 ], [ %doneNode.sroa.0.2.2, %cleanup.2 ]
  %node23.sroa.4.0.copyload.4 = load i8, ptr %node.sroa.4.0.arrayidx.sroa_idx.4, align 4, !tbaa.struct !12
  %7 = and i8 %node23.sroa.4.0.copyload.4, 1
  %tobool.4 = icmp ne i8 %7, 0
  %cmp28.4 = icmp slt i32 %node23.sroa.5121.0.copyload.4277, 0
  %or.cond.4 = select i1 %tobool.4, i1 true, i1 %cmp28.4
  br i1 %or.cond.4, label %cleanup.4, label %if.end30.4

if.end30.4:                                       ; preds = %cleanup.3
  %cmp32.4 = icmp eq i32 %doneNode.sroa.0.2.3, -1
  %cmp36.4 = icmp slt i32 %node23.sroa.5121.0.copyload.4277, %doneNode.sroa.11.2.3
  %or.cond142.4 = select i1 %cmp32.4, i1 true, i1 %cmp36.4
  %doneNode.sroa.11.1.4 = select i1 %or.cond142.4, i32 %node23.sroa.5121.0.copyload.4277, i32 %doneNode.sroa.11.2.3
  %doneNode.sroa.0.1.4 = select i1 %or.cond142.4, i32 4, i32 %doneNode.sroa.0.2.3
  br label %cleanup.4

cleanup.4:                                        ; preds = %if.end30.4, %cleanup.3
  %doneNode.sroa.11.2.4 = phi i32 [ %doneNode.sroa.11.1.4, %if.end30.4 ], [ %doneNode.sroa.11.2.3, %cleanup.3 ]
  %doneNode.sroa.0.2.4 = phi i32 [ %doneNode.sroa.0.1.4, %if.end30.4 ], [ %doneNode.sroa.0.2.3, %cleanup.3 ]
  %node23.sroa.4.0.copyload.5 = load i8, ptr %node.sroa.4.0.arrayidx.sroa_idx.5, align 16, !tbaa.struct !12
  %8 = and i8 %node23.sroa.4.0.copyload.5, 1
  %tobool.5 = icmp ne i8 %8, 0
  %cmp28.5 = icmp slt i32 %node23.sroa.5121.0.copyload.5283, 0
  %or.cond.5 = select i1 %tobool.5, i1 true, i1 %cmp28.5
  br i1 %or.cond.5, label %cleanup.5, label %if.end30.5

if.end30.5:                                       ; preds = %cleanup.4
  %cmp32.5 = icmp eq i32 %doneNode.sroa.0.2.4, -1
  %cmp36.5 = icmp slt i32 %node23.sroa.5121.0.copyload.5283, %doneNode.sroa.11.2.4
  %or.cond142.5 = select i1 %cmp32.5, i1 true, i1 %cmp36.5
  %doneNode.sroa.11.1.5 = select i1 %or.cond142.5, i32 %node23.sroa.5121.0.copyload.5283, i32 %doneNode.sroa.11.2.4
  %doneNode.sroa.0.1.5 = select i1 %or.cond142.5, i32 5, i32 %doneNode.sroa.0.2.4
  br label %cleanup.5

cleanup.5:                                        ; preds = %if.end30.5, %cleanup.4
  %doneNode.sroa.11.2.5 = phi i32 [ %doneNode.sroa.11.1.5, %if.end30.5 ], [ %doneNode.sroa.11.2.4, %cleanup.4 ]
  %doneNode.sroa.0.2.5 = phi i32 [ %doneNode.sroa.0.1.5, %if.end30.5 ], [ %doneNode.sroa.0.2.4, %cleanup.4 ]
  %node23.sroa.4.0.copyload.6 = load i8, ptr %node.sroa.4.0.arrayidx.sroa_idx.6, align 4, !tbaa.struct !12
  %9 = and i8 %node23.sroa.4.0.copyload.6, 1
  %tobool.6 = icmp ne i8 %9, 0
  %cmp28.6 = icmp slt i32 %node23.sroa.5121.0.copyload.6288, 0
  %or.cond.6 = select i1 %tobool.6, i1 true, i1 %cmp28.6
  br i1 %or.cond.6, label %cleanup.6, label %if.end30.6

if.end30.6:                                       ; preds = %cleanup.5
  %cmp32.6 = icmp eq i32 %doneNode.sroa.0.2.5, -1
  %cmp36.6 = icmp slt i32 %node23.sroa.5121.0.copyload.6288, %doneNode.sroa.11.2.5
  %or.cond142.6 = select i1 %cmp32.6, i1 true, i1 %cmp36.6
  %doneNode.sroa.11.1.6 = select i1 %or.cond142.6, i32 %node23.sroa.5121.0.copyload.6288, i32 %doneNode.sroa.11.2.5
  %doneNode.sroa.0.1.6 = select i1 %or.cond142.6, i32 6, i32 %doneNode.sroa.0.2.5
  br label %cleanup.6

cleanup.6:                                        ; preds = %if.end30.6, %cleanup.5
  %doneNode.sroa.11.2.6 = phi i32 [ %doneNode.sroa.11.1.6, %if.end30.6 ], [ %doneNode.sroa.11.2.5, %cleanup.5 ]
  %doneNode.sroa.0.2.6 = phi i32 [ %doneNode.sroa.0.1.6, %if.end30.6 ], [ %doneNode.sroa.0.2.5, %cleanup.5 ]
  %node23.sroa.4.0.copyload.7 = load i8, ptr %node.sroa.4.0.arrayidx.sroa_idx.7, align 8, !tbaa.struct !12
  %10 = and i8 %node23.sroa.4.0.copyload.7, 1
  %tobool.7 = icmp ne i8 %10, 0
  %cmp28.7 = icmp slt i32 %node23.sroa.5121.0.copyload.7292, 0
  %or.cond.7 = select i1 %tobool.7, i1 true, i1 %cmp28.7
  br i1 %or.cond.7, label %cleanup.7, label %if.end30.7

if.end30.7:                                       ; preds = %cleanup.6
  %cmp32.7 = icmp eq i32 %doneNode.sroa.0.2.6, -1
  %cmp36.7 = icmp slt i32 %node23.sroa.5121.0.copyload.7292, %doneNode.sroa.11.2.6
  %or.cond142.7 = select i1 %cmp32.7, i1 true, i1 %cmp36.7
  %doneNode.sroa.11.1.7 = select i1 %or.cond142.7, i32 %node23.sroa.5121.0.copyload.7292, i32 %doneNode.sroa.11.2.6
  %doneNode.sroa.0.1.7 = select i1 %or.cond142.7, i32 7, i32 %doneNode.sroa.0.2.6
  br label %cleanup.7

cleanup.7:                                        ; preds = %if.end30.7, %cleanup.6
  %doneNode.sroa.11.2.7 = phi i32 [ %doneNode.sroa.11.1.7, %if.end30.7 ], [ %doneNode.sroa.11.2.6, %cleanup.6 ]
  %doneNode.sroa.0.2.7 = phi i32 [ %doneNode.sroa.0.1.7, %if.end30.7 ], [ %doneNode.sroa.0.2.6, %cleanup.6 ]
  %node23.sroa.4.0.copyload.8 = load i8, ptr %node.sroa.4.0.arrayidx.sroa_idx.8, align 4, !tbaa.struct !12
  %11 = and i8 %node23.sroa.4.0.copyload.8, 1
  %tobool.8 = icmp ne i8 %11, 0
  %cmp28.8 = icmp slt i32 %node23.sroa.5121.0.copyload.8295, 0
  %or.cond.8 = select i1 %tobool.8, i1 true, i1 %cmp28.8
  br i1 %or.cond.8, label %cleanup.8, label %if.end30.8

if.end30.8:                                       ; preds = %cleanup.7
  %cmp32.8 = icmp eq i32 %doneNode.sroa.0.2.7, -1
  %cmp36.8 = icmp slt i32 %node23.sroa.5121.0.copyload.8295, %doneNode.sroa.11.2.7
  %or.cond142.8 = select i1 %cmp32.8, i1 true, i1 %cmp36.8
  %doneNode.sroa.11.1.8 = select i1 %or.cond142.8, i32 %node23.sroa.5121.0.copyload.8295, i32 %doneNode.sroa.11.2.7
  %doneNode.sroa.0.1.8 = select i1 %or.cond142.8, i32 8, i32 %doneNode.sroa.0.2.7
  br label %cleanup.8

cleanup.8:                                        ; preds = %if.end30.8, %cleanup.7
  %doneNode.sroa.11.2.8 = phi i32 [ %doneNode.sroa.11.1.8, %if.end30.8 ], [ %doneNode.sroa.11.2.7, %cleanup.7 ]
  %doneNode.sroa.0.2.8 = phi i32 [ %doneNode.sroa.0.1.8, %if.end30.8 ], [ %doneNode.sroa.0.2.7, %cleanup.7 ]
  %node23.sroa.4.0.copyload.9 = load i8, ptr %node.sroa.4.0.arrayidx.sroa_idx.9, align 16, !tbaa.struct !12
  %12 = and i8 %node23.sroa.4.0.copyload.9, 1
  %tobool.9 = icmp ne i8 %12, 0
  %cmp28.9 = icmp slt i32 %node23.sroa.5121.0.copyload.9297, 0
  %or.cond.9 = select i1 %tobool.9, i1 true, i1 %cmp28.9
  %cmp44 = icmp eq i32 %doneNode.sroa.0.2.8, -1
  br i1 %or.cond.9, label %cleanup.9, label %if.end30.9

if.end30.9:                                       ; preds = %cleanup.8
  %cmp36.9 = icmp slt i32 %node23.sroa.5121.0.copyload.9297, %doneNode.sroa.11.2.8
  %or.cond142.9 = select i1 %cmp44, i1 true, i1 %cmp36.9
  br i1 %or.cond142.9, label %if.end46.thread, label %if.end46

if.end46.thread:                                  ; preds = %if.end30.9
  store i8 1, ptr %done50222, align 16, !tbaa !16
  br label %for.inc78

cleanup.9:                                        ; preds = %cleanup.8
  br i1 %cmp44, label %while.end, label %if.end46

if.end46:                                         ; preds = %if.end30.9, %cleanup.9
  %idxprom48 = sext i32 %doneNode.sroa.0.2.8 to i64
  %done50 = getelementptr inbounds [10 x %struct.Node], ptr %nodes, i64 0, i64 %idxprom48, i32 1
  store i8 1, ptr %done50, align 4, !tbaa !16
  %mul.i = mul nsw i32 %doneNode.sroa.0.2.8, 10
  %13 = sext i32 %mul.i to i64
  %cmp57 = icmp eq i32 %doneNode.sroa.0.2.8, 0
  br i1 %cmp57, label %for.inc78.1, label %for.inc78

for.inc78:                                        ; preds = %if.end46.thread, %if.end46
  %14 = phi i64 [ 90, %if.end46.thread ], [ %13, %if.end46 ]
  %doneNode.sroa.11.2.9181234 = phi i32 [ %node23.sroa.5121.0.copyload.9297, %if.end46.thread ], [ %doneNode.sroa.11.2.8, %if.end46 ]
  %doneNode.sroa.0.2.9182225 = phi i32 [ 9, %if.end46.thread ], [ %doneNode.sroa.0.2.8, %if.end46 ]
  %arrayidx.i = getelementptr inbounds [100 x i32], ptr @c, i64 0, i64 %14
  %15 = load i32, ptr %arrayidx.i, align 4, !tbaa !5
  %add = add nsw i32 %15, %doneNode.sroa.11.2.9181234
  %cmp72 = icmp slt i32 %add, %2
  %or.cond143 = select i1 %cmp28, i1 true, i1 %cmp72
  %spec.store.select = select i1 %or.cond143, i32 %add, i32 %2
  store i32 %spec.store.select, ptr %node.sroa.5131.0.arrayidx.sroa_idx, align 8
  %cmp57.1 = icmp eq i32 %doneNode.sroa.0.2.9182225, 1
  br i1 %cmp57.1, label %for.inc78.2, label %for.inc78.1

for.inc78.1:                                      ; preds = %if.end46, %for.inc78
  %16 = phi i64 [ %14, %for.inc78 ], [ %13, %if.end46 ]
  %doneNode.sroa.11.2.9181235 = phi i32 [ %doneNode.sroa.11.2.9181234, %for.inc78 ], [ %doneNode.sroa.11.2.8, %if.end46 ]
  %doneNode.sroa.0.2.9182226 = phi i32 [ %doneNode.sroa.0.2.9182225, %for.inc78 ], [ 0, %if.end46 ]
  %node23.sroa.5121.0.copyload176185 = phi i32 [ %spec.store.select, %for.inc78 ], [ %2, %if.end46 ]
  %17 = or i64 %16, 1
  %arrayidx.i.1 = getelementptr inbounds [100 x i32], ptr @c, i64 0, i64 %17
  %18 = load i32, ptr %arrayidx.i.1, align 4, !tbaa !5
  %add.1 = add nsw i32 %18, %doneNode.sroa.11.2.9181235
  %cmp72.1 = icmp slt i32 %add.1, %node23.sroa.5121.0.copyload.1253
  %or.cond143.1 = select i1 %cmp28.1, i1 true, i1 %cmp72.1
  %spec.store.select.1 = select i1 %or.cond143.1, i32 %add.1, i32 %node23.sroa.5121.0.copyload.1253
  store i32 %spec.store.select.1, ptr %cost86, align 4
  %cmp57.2 = icmp eq i32 %doneNode.sroa.0.2.9182226, 2
  br i1 %cmp57.2, label %for.inc78.3, label %for.inc78.2

for.inc78.2:                                      ; preds = %for.inc78, %for.inc78.1
  %node23.sroa.5121.0.copyload.1252 = phi i32 [ %spec.store.select.1, %for.inc78.1 ], [ %node23.sroa.5121.0.copyload.1253, %for.inc78 ]
  %19 = phi i64 [ %16, %for.inc78.1 ], [ %14, %for.inc78 ]
  %doneNode.sroa.11.2.9181236 = phi i32 [ %doneNode.sroa.11.2.9181235, %for.inc78.1 ], [ %doneNode.sroa.11.2.9181234, %for.inc78 ]
  %doneNode.sroa.0.2.9182227 = phi i32 [ %doneNode.sroa.0.2.9182226, %for.inc78.1 ], [ 1, %for.inc78 ]
  %node23.sroa.5121.0.copyload176186189 = phi i32 [ %node23.sroa.5121.0.copyload176185, %for.inc78.1 ], [ %spec.store.select, %for.inc78 ]
  %20 = add nsw i64 %19, 2
  %arrayidx.i.2 = getelementptr inbounds [100 x i32], ptr @c, i64 0, i64 %20
  %21 = load i32, ptr %arrayidx.i.2, align 4, !tbaa !5
  %add.2 = add nsw i32 %21, %doneNode.sroa.11.2.9181236
  %cmp72.2 = icmp slt i32 %add.2, %node23.sroa.5121.0.copyload.2262
  %or.cond143.2 = select i1 %cmp28.2, i1 true, i1 %cmp72.2
  %spec.store.select.2 = select i1 %or.cond143.2, i32 %add.2, i32 %node23.sroa.5121.0.copyload.2262
  store i32 %spec.store.select.2, ptr %cost66.2, align 16
  %cmp57.3 = icmp eq i32 %doneNode.sroa.0.2.9182227, 3
  br i1 %cmp57.3, label %for.inc78.4, label %for.inc78.3

for.inc78.3:                                      ; preds = %for.inc78.1, %for.inc78.2
  %node23.sroa.5121.0.copyload.2261 = phi i32 [ %spec.store.select.2, %for.inc78.2 ], [ %node23.sroa.5121.0.copyload.2262, %for.inc78.1 ]
  %node23.sroa.5121.0.copyload.1250 = phi i32 [ %node23.sroa.5121.0.copyload.1252, %for.inc78.2 ], [ %spec.store.select.1, %for.inc78.1 ]
  %22 = phi i64 [ %19, %for.inc78.2 ], [ %16, %for.inc78.1 ]
  %doneNode.sroa.11.2.9181237 = phi i32 [ %doneNode.sroa.11.2.9181236, %for.inc78.2 ], [ %doneNode.sroa.11.2.9181235, %for.inc78.1 ]
  %doneNode.sroa.0.2.9182228 = phi i32 [ %doneNode.sroa.0.2.9182227, %for.inc78.2 ], [ 2, %for.inc78.1 ]
  %node23.sroa.5121.0.copyload176186190193 = phi i32 [ %node23.sroa.5121.0.copyload176186189, %for.inc78.2 ], [ %node23.sroa.5121.0.copyload176185, %for.inc78.1 ]
  %23 = add nsw i64 %22, 3
  %arrayidx.i.3 = getelementptr inbounds [100 x i32], ptr @c, i64 0, i64 %23
  %24 = load i32, ptr %arrayidx.i.3, align 4, !tbaa !5
  %add.3 = add nsw i32 %24, %doneNode.sroa.11.2.9181237
  %cmp72.3 = icmp slt i32 %add.3, %node23.sroa.5121.0.copyload.3270
  %or.cond143.3 = select i1 %cmp28.3, i1 true, i1 %cmp72.3
  %spec.store.select.3 = select i1 %or.cond143.3, i32 %add.3, i32 %node23.sroa.5121.0.copyload.3270
  store i32 %spec.store.select.3, ptr %cost66.3, align 4
  %cmp57.4 = icmp eq i32 %doneNode.sroa.0.2.9182228, 4
  br i1 %cmp57.4, label %for.inc78.5, label %for.inc78.4

for.inc78.4:                                      ; preds = %for.inc78.2, %for.inc78.3
  %node23.sroa.5121.0.copyload.3269 = phi i32 [ %spec.store.select.3, %for.inc78.3 ], [ %node23.sroa.5121.0.copyload.3270, %for.inc78.2 ]
  %node23.sroa.5121.0.copyload.2259 = phi i32 [ %node23.sroa.5121.0.copyload.2261, %for.inc78.3 ], [ %spec.store.select.2, %for.inc78.2 ]
  %node23.sroa.5121.0.copyload.1251 = phi i32 [ %node23.sroa.5121.0.copyload.1250, %for.inc78.3 ], [ %node23.sroa.5121.0.copyload.1252, %for.inc78.2 ]
  %25 = phi i64 [ %22, %for.inc78.3 ], [ %19, %for.inc78.2 ]
  %doneNode.sroa.11.2.9181238 = phi i32 [ %doneNode.sroa.11.2.9181237, %for.inc78.3 ], [ %doneNode.sroa.11.2.9181236, %for.inc78.2 ]
  %doneNode.sroa.0.2.9182229 = phi i32 [ %doneNode.sroa.0.2.9182228, %for.inc78.3 ], [ 3, %for.inc78.2 ]
  %node23.sroa.5121.0.copyload176186190194197 = phi i32 [ %node23.sroa.5121.0.copyload176186190193, %for.inc78.3 ], [ %node23.sroa.5121.0.copyload176186189, %for.inc78.2 ]
  %26 = add nsw i64 %25, 4
  %arrayidx.i.4 = getelementptr inbounds [100 x i32], ptr @c, i64 0, i64 %26
  %27 = load i32, ptr %arrayidx.i.4, align 4, !tbaa !5
  %add.4 = add nsw i32 %27, %doneNode.sroa.11.2.9181238
  %cmp72.4 = icmp slt i32 %add.4, %node23.sroa.5121.0.copyload.4277
  %or.cond143.4 = select i1 %cmp28.4, i1 true, i1 %cmp72.4
  %spec.store.select.4 = select i1 %or.cond143.4, i32 %add.4, i32 %node23.sroa.5121.0.copyload.4277
  store i32 %spec.store.select.4, ptr %cost66.4, align 8
  %cmp57.5 = icmp eq i32 %doneNode.sroa.0.2.9182229, 5
  br i1 %cmp57.5, label %for.inc78.6, label %for.inc78.5

for.inc78.5:                                      ; preds = %for.inc78.3, %for.inc78.4
  %node23.sroa.5121.0.copyload.4276 = phi i32 [ %spec.store.select.4, %for.inc78.4 ], [ %node23.sroa.5121.0.copyload.4277, %for.inc78.3 ]
  %node23.sroa.5121.0.copyload.3267 = phi i32 [ %node23.sroa.5121.0.copyload.3269, %for.inc78.4 ], [ %spec.store.select.3, %for.inc78.3 ]
  %node23.sroa.5121.0.copyload.2260 = phi i32 [ %node23.sroa.5121.0.copyload.2259, %for.inc78.4 ], [ %node23.sroa.5121.0.copyload.2261, %for.inc78.3 ]
  %node23.sroa.5121.0.copyload.1249 = phi i32 [ %node23.sroa.5121.0.copyload.1251, %for.inc78.4 ], [ %node23.sroa.5121.0.copyload.1250, %for.inc78.3 ]
  %28 = phi i64 [ %25, %for.inc78.4 ], [ %22, %for.inc78.3 ]
  %doneNode.sroa.11.2.9181239 = phi i32 [ %doneNode.sroa.11.2.9181238, %for.inc78.4 ], [ %doneNode.sroa.11.2.9181237, %for.inc78.3 ]
  %doneNode.sroa.0.2.9182230 = phi i32 [ %doneNode.sroa.0.2.9182229, %for.inc78.4 ], [ 4, %for.inc78.3 ]
  %node23.sroa.5121.0.copyload176186190194198201 = phi i32 [ %node23.sroa.5121.0.copyload176186190194197, %for.inc78.4 ], [ %node23.sroa.5121.0.copyload176186190193, %for.inc78.3 ]
  %29 = add nsw i64 %28, 5
  %arrayidx.i.5 = getelementptr inbounds [100 x i32], ptr @c, i64 0, i64 %29
  %30 = load i32, ptr %arrayidx.i.5, align 4, !tbaa !5
  %add.5 = add nsw i32 %30, %doneNode.sroa.11.2.9181239
  %cmp72.5 = icmp slt i32 %add.5, %node23.sroa.5121.0.copyload.5283
  %or.cond143.5 = select i1 %cmp28.5, i1 true, i1 %cmp72.5
  %spec.store.select.5 = select i1 %or.cond143.5, i32 %add.5, i32 %node23.sroa.5121.0.copyload.5283
  store i32 %spec.store.select.5, ptr %cost66.5, align 4
  %cmp57.6 = icmp eq i32 %doneNode.sroa.0.2.9182230, 6
  br i1 %cmp57.6, label %for.inc78.7, label %for.inc78.6

for.inc78.6:                                      ; preds = %for.inc78.4, %for.inc78.5
  %node23.sroa.5121.0.copyload.5282 = phi i32 [ %spec.store.select.5, %for.inc78.5 ], [ %node23.sroa.5121.0.copyload.5283, %for.inc78.4 ]
  %node23.sroa.5121.0.copyload.4274 = phi i32 [ %node23.sroa.5121.0.copyload.4276, %for.inc78.5 ], [ %spec.store.select.4, %for.inc78.4 ]
  %node23.sroa.5121.0.copyload.3268 = phi i32 [ %node23.sroa.5121.0.copyload.3267, %for.inc78.5 ], [ %node23.sroa.5121.0.copyload.3269, %for.inc78.4 ]
  %node23.sroa.5121.0.copyload.2258 = phi i32 [ %node23.sroa.5121.0.copyload.2260, %for.inc78.5 ], [ %node23.sroa.5121.0.copyload.2259, %for.inc78.4 ]
  %node23.sroa.5121.0.copyload.1247 = phi i32 [ %node23.sroa.5121.0.copyload.1249, %for.inc78.5 ], [ %node23.sroa.5121.0.copyload.1251, %for.inc78.4 ]
  %31 = phi i64 [ %28, %for.inc78.5 ], [ %25, %for.inc78.4 ]
  %doneNode.sroa.11.2.9181240 = phi i32 [ %doneNode.sroa.11.2.9181239, %for.inc78.5 ], [ %doneNode.sroa.11.2.9181238, %for.inc78.4 ]
  %doneNode.sroa.0.2.9182231 = phi i32 [ %doneNode.sroa.0.2.9182230, %for.inc78.5 ], [ 5, %for.inc78.4 ]
  %node23.sroa.5121.0.copyload176186190194198202205 = phi i32 [ %node23.sroa.5121.0.copyload176186190194198201, %for.inc78.5 ], [ %node23.sroa.5121.0.copyload176186190194197, %for.inc78.4 ]
  %32 = add nsw i64 %31, 6
  %arrayidx.i.6 = getelementptr inbounds [100 x i32], ptr @c, i64 0, i64 %32
  %33 = load i32, ptr %arrayidx.i.6, align 4, !tbaa !5
  %add.6 = add nsw i32 %33, %doneNode.sroa.11.2.9181240
  %cmp72.6 = icmp slt i32 %add.6, %node23.sroa.5121.0.copyload.6288
  %or.cond143.6 = select i1 %cmp28.6, i1 true, i1 %cmp72.6
  %spec.store.select.6 = select i1 %or.cond143.6, i32 %add.6, i32 %node23.sroa.5121.0.copyload.6288
  store i32 %spec.store.select.6, ptr %cost66.6, align 16
  %cmp57.7 = icmp eq i32 %doneNode.sroa.0.2.9182231, 7
  br i1 %cmp57.7, label %for.inc78.8, label %for.inc78.7

for.inc78.7:                                      ; preds = %for.inc78.5, %for.inc78.6
  %node23.sroa.5121.0.copyload.6287 = phi i32 [ %spec.store.select.6, %for.inc78.6 ], [ %node23.sroa.5121.0.copyload.6288, %for.inc78.5 ]
  %node23.sroa.5121.0.copyload.5280 = phi i32 [ %node23.sroa.5121.0.copyload.5282, %for.inc78.6 ], [ %spec.store.select.5, %for.inc78.5 ]
  %node23.sroa.5121.0.copyload.4275 = phi i32 [ %node23.sroa.5121.0.copyload.4274, %for.inc78.6 ], [ %node23.sroa.5121.0.copyload.4276, %for.inc78.5 ]
  %node23.sroa.5121.0.copyload.3266 = phi i32 [ %node23.sroa.5121.0.copyload.3268, %for.inc78.6 ], [ %node23.sroa.5121.0.copyload.3267, %for.inc78.5 ]
  %node23.sroa.5121.0.copyload.2256 = phi i32 [ %node23.sroa.5121.0.copyload.2258, %for.inc78.6 ], [ %node23.sroa.5121.0.copyload.2260, %for.inc78.5 ]
  %node23.sroa.5121.0.copyload.1248 = phi i32 [ %node23.sroa.5121.0.copyload.1247, %for.inc78.6 ], [ %node23.sroa.5121.0.copyload.1249, %for.inc78.5 ]
  %34 = phi i64 [ %31, %for.inc78.6 ], [ %28, %for.inc78.5 ]
  %doneNode.sroa.11.2.9181241 = phi i32 [ %doneNode.sroa.11.2.9181240, %for.inc78.6 ], [ %doneNode.sroa.11.2.9181239, %for.inc78.5 ]
  %doneNode.sroa.0.2.9182232 = phi i32 [ %doneNode.sroa.0.2.9182231, %for.inc78.6 ], [ 6, %for.inc78.5 ]
  %node23.sroa.5121.0.copyload176186190194198202206209 = phi i32 [ %node23.sroa.5121.0.copyload176186190194198202205, %for.inc78.6 ], [ %node23.sroa.5121.0.copyload176186190194198201, %for.inc78.5 ]
  %35 = add nsw i64 %34, 7
  %arrayidx.i.7 = getelementptr inbounds [100 x i32], ptr @c, i64 0, i64 %35
  %36 = load i32, ptr %arrayidx.i.7, align 4, !tbaa !5
  %add.7 = add nsw i32 %36, %doneNode.sroa.11.2.9181241
  %cmp72.7 = icmp slt i32 %add.7, %node23.sroa.5121.0.copyload.7292
  %or.cond143.7 = select i1 %cmp28.7, i1 true, i1 %cmp72.7
  %spec.store.select.7 = select i1 %or.cond143.7, i32 %add.7, i32 %node23.sroa.5121.0.copyload.7292
  store i32 %spec.store.select.7, ptr %cost66.7, align 4
  %cmp57.8 = icmp eq i32 %doneNode.sroa.0.2.9182232, 8
  br i1 %cmp57.8, label %if.end59.9, label %for.inc78.8

for.inc78.8:                                      ; preds = %for.inc78.6, %for.inc78.7
  %node23.sroa.5121.0.copyload.7291 = phi i32 [ %spec.store.select.7, %for.inc78.7 ], [ %node23.sroa.5121.0.copyload.7292, %for.inc78.6 ]
  %node23.sroa.5121.0.copyload.6285 = phi i32 [ %node23.sroa.5121.0.copyload.6287, %for.inc78.7 ], [ %spec.store.select.6, %for.inc78.6 ]
  %node23.sroa.5121.0.copyload.5281 = phi i32 [ %node23.sroa.5121.0.copyload.5280, %for.inc78.7 ], [ %node23.sroa.5121.0.copyload.5282, %for.inc78.6 ]
  %node23.sroa.5121.0.copyload.4273 = phi i32 [ %node23.sroa.5121.0.copyload.4275, %for.inc78.7 ], [ %node23.sroa.5121.0.copyload.4274, %for.inc78.6 ]
  %node23.sroa.5121.0.copyload.3264 = phi i32 [ %node23.sroa.5121.0.copyload.3266, %for.inc78.7 ], [ %node23.sroa.5121.0.copyload.3268, %for.inc78.6 ]
  %node23.sroa.5121.0.copyload.2257 = phi i32 [ %node23.sroa.5121.0.copyload.2256, %for.inc78.7 ], [ %node23.sroa.5121.0.copyload.2258, %for.inc78.6 ]
  %node23.sroa.5121.0.copyload.1246 = phi i32 [ %node23.sroa.5121.0.copyload.1248, %for.inc78.7 ], [ %node23.sroa.5121.0.copyload.1247, %for.inc78.6 ]
  %37 = phi i64 [ %34, %for.inc78.7 ], [ %31, %for.inc78.6 ]
  %doneNode.sroa.11.2.9181242 = phi i32 [ %doneNode.sroa.11.2.9181241, %for.inc78.7 ], [ %doneNode.sroa.11.2.9181240, %for.inc78.6 ]
  %doneNode.sroa.0.2.9182233 = phi i32 [ %doneNode.sroa.0.2.9182232, %for.inc78.7 ], [ 7, %for.inc78.6 ]
  %node23.sroa.5121.0.copyload176186190194198202206210213 = phi i32 [ %node23.sroa.5121.0.copyload176186190194198202206209, %for.inc78.7 ], [ %node23.sroa.5121.0.copyload176186190194198202205, %for.inc78.6 ]
  %38 = add nsw i64 %37, 8
  %arrayidx.i.8 = getelementptr inbounds [100 x i32], ptr @c, i64 0, i64 %38
  %39 = load i32, ptr %arrayidx.i.8, align 4, !tbaa !5
  %add.8 = add nsw i32 %39, %doneNode.sroa.11.2.9181242
  %cmp72.8 = icmp slt i32 %add.8, %node23.sroa.5121.0.copyload.8295
  %or.cond143.8 = select i1 %cmp28.8, i1 true, i1 %cmp72.8
  %spec.store.select.8 = select i1 %or.cond143.8, i32 %add.8, i32 %node23.sroa.5121.0.copyload.8295
  store i32 %spec.store.select.8, ptr %cost66.8, align 8
  %cmp57.9 = icmp eq i32 %doneNode.sroa.0.2.9182233, 9
  br i1 %cmp57.9, label %for.inc78.9, label %if.end59.9

if.end59.9:                                       ; preds = %for.inc78.7, %for.inc78.8
  %node23.sroa.5121.0.copyload.8294 = phi i32 [ %spec.store.select.8, %for.inc78.8 ], [ %node23.sroa.5121.0.copyload.8295, %for.inc78.7 ]
  %node23.sroa.5121.0.copyload.7289 = phi i32 [ %node23.sroa.5121.0.copyload.7291, %for.inc78.8 ], [ %spec.store.select.7, %for.inc78.7 ]
  %node23.sroa.5121.0.copyload.6286 = phi i32 [ %node23.sroa.5121.0.copyload.6285, %for.inc78.8 ], [ %node23.sroa.5121.0.copyload.6287, %for.inc78.7 ]
  %node23.sroa.5121.0.copyload.5279 = phi i32 [ %node23.sroa.5121.0.copyload.5281, %for.inc78.8 ], [ %node23.sroa.5121.0.copyload.5280, %for.inc78.7 ]
  %node23.sroa.5121.0.copyload.4271 = phi i32 [ %node23.sroa.5121.0.copyload.4273, %for.inc78.8 ], [ %node23.sroa.5121.0.copyload.4275, %for.inc78.7 ]
  %node23.sroa.5121.0.copyload.3265 = phi i32 [ %node23.sroa.5121.0.copyload.3264, %for.inc78.8 ], [ %node23.sroa.5121.0.copyload.3266, %for.inc78.7 ]
  %node23.sroa.5121.0.copyload.2255 = phi i32 [ %node23.sroa.5121.0.copyload.2257, %for.inc78.8 ], [ %node23.sroa.5121.0.copyload.2256, %for.inc78.7 ]
  %node23.sroa.5121.0.copyload.1244 = phi i32 [ %node23.sroa.5121.0.copyload.1246, %for.inc78.8 ], [ %node23.sroa.5121.0.copyload.1248, %for.inc78.7 ]
  %40 = phi i64 [ %37, %for.inc78.8 ], [ %34, %for.inc78.7 ]
  %doneNode.sroa.11.2.9181243 = phi i32 [ %doneNode.sroa.11.2.9181242, %for.inc78.8 ], [ %doneNode.sroa.11.2.9181241, %for.inc78.7 ]
  %node23.sroa.5121.0.copyload176186190194198202206210214217 = phi i32 [ %node23.sroa.5121.0.copyload176186190194198202206210213, %for.inc78.8 ], [ %node23.sroa.5121.0.copyload176186190194198202206209, %for.inc78.7 ]
  %41 = add nsw i64 %40, 9
  %arrayidx.i.9 = getelementptr inbounds [100 x i32], ptr @c, i64 0, i64 %41
  %42 = load i32, ptr %arrayidx.i.9, align 4, !tbaa !5
  %add.9 = add nsw i32 %42, %doneNode.sroa.11.2.9181243
  %cmp72.9 = icmp slt i32 %add.9, %node23.sroa.5121.0.copyload.9297
  %or.cond143.9 = select i1 %cmp28.9, i1 true, i1 %cmp72.9
  %spec.store.select.9 = select i1 %or.cond143.9, i32 %add.9, i32 %node23.sroa.5121.0.copyload.9297
  store i32 %spec.store.select.9, ptr %cost66.9, align 4
  br label %for.inc78.9

for.inc78.9:                                      ; preds = %if.end59.9, %for.inc78.8
  %node23.sroa.5121.0.copyload.9296 = phi i32 [ %spec.store.select.9, %if.end59.9 ], [ %node23.sroa.5121.0.copyload.9297, %for.inc78.8 ]
  %node23.sroa.5121.0.copyload.8293 = phi i32 [ %node23.sroa.5121.0.copyload.8294, %if.end59.9 ], [ %spec.store.select.8, %for.inc78.8 ]
  %node23.sroa.5121.0.copyload.7290 = phi i32 [ %node23.sroa.5121.0.copyload.7289, %if.end59.9 ], [ %node23.sroa.5121.0.copyload.7291, %for.inc78.8 ]
  %node23.sroa.5121.0.copyload.6284 = phi i32 [ %node23.sroa.5121.0.copyload.6286, %if.end59.9 ], [ %node23.sroa.5121.0.copyload.6285, %for.inc78.8 ]
  %node23.sroa.5121.0.copyload.5278 = phi i32 [ %node23.sroa.5121.0.copyload.5279, %if.end59.9 ], [ %node23.sroa.5121.0.copyload.5281, %for.inc78.8 ]
  %node23.sroa.5121.0.copyload.4272 = phi i32 [ %node23.sroa.5121.0.copyload.4271, %if.end59.9 ], [ %node23.sroa.5121.0.copyload.4273, %for.inc78.8 ]
  %node23.sroa.5121.0.copyload.3263 = phi i32 [ %node23.sroa.5121.0.copyload.3265, %if.end59.9 ], [ %node23.sroa.5121.0.copyload.3264, %for.inc78.8 ]
  %node23.sroa.5121.0.copyload.2254 = phi i32 [ %node23.sroa.5121.0.copyload.2255, %if.end59.9 ], [ %node23.sroa.5121.0.copyload.2257, %for.inc78.8 ]
  %node23.sroa.5121.0.copyload.1245 = phi i32 [ %node23.sroa.5121.0.copyload.1244, %if.end59.9 ], [ %node23.sroa.5121.0.copyload.1246, %for.inc78.8 ]
  %node23.sroa.5121.0.copyload176186190194198202206210214218 = phi i32 [ %node23.sroa.5121.0.copyload176186190194198202206210214217, %if.end59.9 ], [ %node23.sroa.5121.0.copyload176186190194198202206210213, %for.inc78.8 ]
  %node23.sroa.4.0.copyload.pre = load i8, ptr %node.sroa.4.0.arrayidx.sroa_idx, align 4, !tbaa.struct !12
  br label %while.cond

while.end:                                        ; preds = %cleanup.9
  %arrayidx88 = getelementptr inbounds [10 x i32], ptr %costs, i64 0, i64 %indvars.iv171
  store i32 %node23.sroa.5121.0.copyload.1253, ptr %arrayidx88, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 120, ptr nonnull %nodes) #5
  br label %for.inc89

for.inc89:                                        ; preds = %for.body5, %while.end
  %indvars.iv.next172 = add nuw nsw i64 %indvars.iv171, 1
  %exitcond174.not = icmp eq i64 %indvars.iv.next172, 10
  br i1 %exitcond174.not, label %for.cond94.preheader, label %for.body5

for.cond.cleanup96:                               ; preds = %if.end104, %for.cond94.preheader
  %ans.0.lcssa = phi i32 [ 0, %for.cond94.preheader ], [ %ans.1, %if.end104 ]
  %call109 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %ans.0.lcssa)
  call void @llvm.lifetime.end.p0(i64 40, ptr nonnull %costs) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %w) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %h) #5
  ret i32 0

for.body97:                                       ; preds = %for.cond94.preheader, %if.end104
  %i93.0156 = phi i32 [ %inc106, %if.end104 ], [ 0, %for.cond94.preheader ]
  %ans.0155 = phi i32 [ %ans.1, %if.end104 ], [ 0, %for.cond94.preheader ]
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #5
  %call98 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %a)
  %43 = load i32, ptr %a, align 4, !tbaa !5
  %cmp99.not = icmp eq i32 %43, -1
  br i1 %cmp99.not, label %if.end104, label %if.then100

if.then100:                                       ; preds = %for.body97
  %idxprom101 = sext i32 %43 to i64
  %arrayidx102 = getelementptr inbounds [10 x i32], ptr %costs, i64 0, i64 %idxprom101
  %44 = load i32, ptr %arrayidx102, align 4, !tbaa !5
  %add103 = add nsw i32 %44, %ans.0155
  br label %if.end104

if.end104:                                        ; preds = %if.then100, %for.body97
  %ans.1 = phi i32 [ %add103, %if.then100 ], [ %ans.0155, %for.body97 ]
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #5
  %inc106 = add nuw nsw i32 %i93.0156, 1
  %45 = load i32, ptr %h, align 4, !tbaa !5
  %46 = load i32, ptr %w, align 4, !tbaa !5
  %mul = mul nsw i32 %46, %45
  %cmp95 = icmp slt i32 %inc106, %mul
  br i1 %cmp95, label %for.body97, label %for.cond.cleanup96
}

; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #2

; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3

; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #2

; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #4

; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3

attributes #0 = { mustprogress nofree norecurse nosync nounwind willreturn memory(read, argmem: none, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #5 = { nounwind }

!llvm.linker.options = !{}
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{i64 0, i64 4, !5, i64 4, i64 1, !10, i64 8, i64 4, !5}
!10 = !{!11, !11, i64 0}
!11 = !{!"_Bool", !7, i64 0}
!12 = !{i64 0, i64 1, !10, i64 4, i64 4, !5}
!13 = !{i64 0, i64 4, !5}
!14 = !{!15, !6, i64 8}
!15 = !{!"Node", !6, i64 0, !11, i64 4, !6, i64 8}
!16 = !{!15, !11, i64 4}
