program dividing_chocolate
  implicit none
  integer :: h, w, k, a(10,1000) = 0, i, j, l, m, c(10), d(10), u, x = 1e9, y
  character(1000) :: s
  read(*,*) h, w, k
  do i = 1, h
    read(*,'(a)') s
    do j = 1, w
      if (s(j:j) == "1") a(i,j) = 1
    end do
  end do
  if (h == 1) then
    write(*,'(i0)') sum(a(1,1:w))/k
    stop
  end if
  u = lshift(1,h-1)
  do l = 0, u-1
    c = 0
    d = 0
    y = popcnt(l)
    do j = 1, w
      m = 1
      do i = 1, h
        if (i /= 1 .and. btest(l,i-2)) m = m+1
        c(m) = c(m)+a(i,j)
      end do
      if (any(c > k)) then
        y = y+1
        c = c-d
        if (any(c > k)) goto 100
      end if
      d = c
    end do
    x = min(x,y)
100 end do
  write(*,'(i0)') x
end program dividing_chocolate
; ModuleID = 'FIRModule'
source_filename = "FIRModule"
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"

@_QFEa = internal global [1000 x [10 x i32]] zeroinitializer
@_QFEc = internal unnamed_addr global [10 x i32] undef
@_QFEd = internal unnamed_addr global [10 x i32] undef
@_QFEs = internal global [1000 x i8] undef
@_QFEx = internal unnamed_addr global i32 1000000000
@_QQcl.2d0a5737d75ea9bd60fe119737e5c977 = linkonce constant [73 x i8] c"/home/ubuntu/Downloads/TheStack_IR/Collated/Fortran/Source_2069/source.f\00"
@_QQcl.286129 = linkonce constant [3 x i8] c"(a)"
@_QQcl.31 = linkonce constant [1 x i8] c"1"
@_QQcl.28693029 = linkonce constant [4 x i8] c"(i0)"
@_QQEnvironmentDefaults = local_unnamed_addr constant ptr null

; Function Attrs: mustprogress nofree nounwind willreturn allockind("alloc,uninitialized") allocsize(0) memory(inaccessiblemem: readwrite)
declare noalias noundef ptr @malloc(i64 noundef) local_unnamed_addr #0

; Function Attrs: mustprogress nounwind willreturn allockind("free") memory(argmem: readwrite, inaccessiblemem: readwrite)
declare void @free(ptr allocptr nocapture noundef) local_unnamed_addr #1

define void @_QQmain() local_unnamed_addr {
  %1 = alloca { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, align 8
  %2 = alloca { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, align 8
  %3 = alloca { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, align 8
  %4 = alloca i32, align 4
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  %7 = tail call ptr @_FortranAioBeginExternalListInput(i32 -1, ptr nonnull @_QQcl.2d0a5737d75ea9bd60fe119737e5c977, i32 5)
  %8 = call i1 @_FortranAioInputInteger(ptr %7, ptr nonnull %4, i32 4)
  %9 = call i1 @_FortranAioInputInteger(ptr %7, ptr nonnull %6, i32 4)
  %10 = call i1 @_FortranAioInputInteger(ptr %7, ptr nonnull %5, i32 4)
  %11 = call i32 @_FortranAioEndIoStatement(ptr %7)
  %12 = load i32, ptr %4, align 4, !tbaa !3
  %13 = icmp sgt i32 %12, 0
  br i1 %13, label %.lr.ph83.preheader, label %._crit_edge84.thread

.lr.ph83.preheader:                               ; preds = %0
  %14 = zext i32 %12 to i64
  br label %.lr.ph83

.lr.ph83:                                         ; preds = %.lr.ph83.preheader, %._crit_edge
  %indvars.iv99 = phi i64 [ 1, %.lr.ph83.preheader ], [ %indvars.iv.next100, %._crit_edge ]
  %15 = call ptr @_FortranAioBeginExternalFormattedInput(ptr nonnull @_QQcl.286129, i64 3, ptr null, i32 -1, ptr nonnull @_QQcl.2d0a5737d75ea9bd60fe119737e5c977, i32 7)
  %16 = call i1 @_FortranAioInputAscii(ptr %15, ptr nonnull @_QFEs, i64 1000)
  %17 = call i32 @_FortranAioEndIoStatement(ptr %15)
  %18 = load i32, ptr %6, align 4, !tbaa !3
  %19 = icmp sgt i32 %18, 0
  br i1 %19, label %.lr.ph, label %._crit_edge

.lr.ph:                                           ; preds = %.lr.ph83
  %20 = zext i32 %18 to i64
  %21 = add nsw i64 %indvars.iv99, -1
  br label %22

22:                                               ; preds = %.lr.ph, %29
  %indvars.iv = phi i64 [ 1, %.lr.ph ], [ %indvars.iv.next, %29 ]
  %23 = add nsw i64 %indvars.iv, -1
  %24 = getelementptr [1000 x [1 x i8]], ptr @_QFEs, i64 0, i64 %23
  %25 = call i32 @_FortranACharacterCompareScalar1(ptr %24, ptr nonnull @_QQcl.31, i64 1, i64 1)
  %26 = icmp eq i32 %25, 0
  br i1 %26, label %27, label %29

27:                                               ; preds = %22
  %28 = getelementptr [1000 x [10 x i32]], ptr @_QFEa, i64 0, i64 %23, i64 %21
  store i32 1, ptr %28, align 4, !tbaa !3
  br label %29

29:                                               ; preds = %27, %22
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %exitcond.not = icmp eq i64 %indvars.iv, %20
  br i1 %exitcond.not, label %._crit_edge, label %22

._crit_edge:                                      ; preds = %29, %.lr.ph83
  %indvars.iv.next100 = add nuw nsw i64 %indvars.iv99, 1
  %exitcond102.not = icmp eq i64 %indvars.iv99, %14
  br i1 %exitcond102.not, label %._crit_edge84, label %.lr.ph83

._crit_edge84:                                    ; preds = %._crit_edge
  %.pre = load i32, ptr %4, align 4, !tbaa !3
  %30 = icmp eq i32 %.pre, 1
  br i1 %30, label %31, label %._crit_edge84.thread

31:                                               ; preds = %._crit_edge84
  %32 = call ptr @_FortranAioBeginExternalFormattedOutput(ptr nonnull @_QQcl.28693029, i64 4, ptr null, i32 -1, ptr nonnull @_QQcl.2d0a5737d75ea9bd60fe119737e5c977, i32 13)
  %33 = load i32, ptr %6, align 4, !tbaa !3
  %34 = call i32 @llvm.smax.i32(i32 %33, i32 0)
  %35 = zext i32 %34 to i64
  store ptr @_QFEa, ptr %1, align 8, !tbaa !7
  %.fca.1.gep45 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, ptr %1, i64 0, i32 1
  store i64 4, ptr %.fca.1.gep45, align 8, !tbaa !7
  %.fca.2.gep47 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, ptr %1, i64 0, i32 2
  store i32 20180515, ptr %.fca.2.gep47, align 8, !tbaa !7
  %.fca.3.gep49 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, ptr %1, i64 0, i32 3
  store i8 1, ptr %.fca.3.gep49, align 4, !tbaa !7
  %.fca.4.gep51 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, ptr %1, i64 0, i32 4
  store i8 9, ptr %.fca.4.gep51, align 1, !tbaa !7
  %.fca.5.gep53 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, ptr %1, i64 0, i32 5
  store i8 0, ptr %.fca.5.gep53, align 2, !tbaa !7
  %.fca.6.gep55 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, ptr %1, i64 0, i32 6
  store i8 0, ptr %.fca.6.gep55, align 1, !tbaa !7
  %.fca.7.0.0.gep57 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, ptr %1, i64 0, i32 7, i64 0, i64 0
  store i64 1, ptr %.fca.7.0.0.gep57, align 8, !tbaa !7
  %.fca.7.0.1.gep59 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, ptr %1, i64 0, i32 7, i64 0, i64 1
  store i64 %35, ptr %.fca.7.0.1.gep59, align 8, !tbaa !7
  %.fca.7.0.2.gep61 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, ptr %1, i64 0, i32 7, i64 0, i64 2
  store i64 40, ptr %.fca.7.0.2.gep61, align 8, !tbaa !7
  %36 = call i32 @_FortranASumInteger4x1_contract_simplified(ptr nonnull %1)
  %37 = load i32, ptr %5, align 4, !tbaa !3
  %38 = sdiv i32 %36, %37
  %39 = call i1 @_FortranAioOutputInteger32(ptr %32, i32 %38)
  %40 = call i32 @_FortranAioEndIoStatement(ptr %32)
  %41 = call {} @_FortranAStopStatement(i32 0, i1 false, i1 false)
  unreachable

._crit_edge84.thread:                             ; preds = %0, %._crit_edge84
  %42 = phi i32 [ %.pre, %._crit_edge84 ], [ %12, %0 ]
  %43 = add i32 %42, -1
  %44 = icmp ugt i32 %43, 31
  %45 = shl nuw i32 1, %43
  %spec.select78 = select i1 %44, i32 0, i32 %45
  %46 = icmp sgt i32 %spec.select78, 0
  br i1 %46, label %.preheader80.lr.ph, label %select.unfold._crit_edge

.preheader80.lr.ph:                               ; preds = %._crit_edge84.thread
  %.fca.1.gep = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, ptr %3, i64 0, i32 1
  %.fca.2.gep = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, ptr %3, i64 0, i32 2
  %.fca.3.gep = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, ptr %3, i64 0, i32 3
  %.fca.4.gep = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, ptr %3, i64 0, i32 4
  %.fca.5.gep = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, ptr %3, i64 0, i32 5
  %.fca.6.gep = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, ptr %3, i64 0, i32 6
  %.fca.7.0.0.gep = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, ptr %3, i64 0, i32 7, i64 0, i64 0
  %.fca.7.0.1.gep = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, ptr %3, i64 0, i32 7, i64 0, i64 1
  %.fca.7.0.2.gep = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, ptr %3, i64 0, i32 7, i64 0, i64 2
  %.fca.1.gep25 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, ptr %2, i64 0, i32 1
  %.fca.2.gep27 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, ptr %2, i64 0, i32 2
  %.fca.3.gep29 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, ptr %2, i64 0, i32 3
  %.fca.4.gep31 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, ptr %2, i64 0, i32 4
  %.fca.5.gep33 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, ptr %2, i64 0, i32 5
  %.fca.6.gep35 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, ptr %2, i64 0, i32 6
  %.fca.7.0.0.gep37 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, ptr %2, i64 0, i32 7, i64 0, i64 0
  %.fca.7.0.1.gep39 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, ptr %2, i64 0, i32 7, i64 0, i64 1
  %.fca.7.0.2.gep41 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, ptr %2, i64 0, i32 7, i64 0, i64 2
  br label %.preheader80

.preheader80:                                     ; preds = %.preheader80.lr.ph, %select.unfold
  %.06596 = phi i32 [ 0, %.preheader80.lr.ph ], [ %181, %select.unfold ]
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(40) @_QFEc, i8 0, i64 40, i1 false), !tbaa !3
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(40) @_QFEd, i8 0, i64 40, i1 false), !tbaa !3
  %47 = call i32 @llvm.ctpop.i32(i32 %.06596), !range !9
  %48 = load i32, ptr %6, align 4, !tbaa !3
  %49 = icmp sgt i32 %48, 0
  br i1 %49, label %.lr.ph93, label %._crit_edge94

.lr.ph93:                                         ; preds = %.preheader80, %.preheader
  %.091 = phi i32 [ %.1.ph, %.preheader ], [ %47, %.preheader80 ]
  %.06689 = phi i32 [ %178, %.preheader ], [ 1, %.preheader80 ]
  %50 = load i32, ptr %4, align 4, !tbaa !3
  %51 = icmp sgt i32 %50, 0
  br i1 %51, label %.lr.ph87, label %._crit_edge88

.lr.ph87:                                         ; preds = %.lr.ph93
  %52 = zext i32 %50 to i64
  %53 = sext i32 %.06689 to i64
  %54 = add nsw i64 %53, -1
  br label %55

55:                                               ; preds = %.lr.ph87, %55
  %indvars.iv103 = phi i64 [ 1, %.lr.ph87 ], [ %indvars.iv.next104, %55 ]
  %.06385 = phi i32 [ 1, %.lr.ph87 ], [ %spec.select, %55 ]
  %56 = icmp ne i64 %indvars.iv103, 1
  %57 = trunc i64 %indvars.iv103 to i32
  %58 = add i32 %57, -2
  %59 = shl nuw i32 1, %58
  %60 = and i32 %59, %.06596
  %61 = icmp ne i32 %60, 0
  %62 = and i1 %56, %61
  %63 = zext i1 %62 to i32
  %spec.select = add i32 %.06385, %63
  %64 = sext i32 %spec.select to i64
  %65 = add nsw i64 %64, -1
  %66 = getelementptr [10 x i32], ptr @_QFEc, i64 0, i64 %65
  %67 = load i32, ptr %66, align 4, !tbaa !3
  %68 = add nsw i64 %indvars.iv103, -1
  %69 = getelementptr [1000 x [10 x i32]], ptr @_QFEa, i64 0, i64 %54, i64 %68
  %70 = load i32, ptr %69, align 4, !tbaa !3
  %71 = add i32 %70, %67
  store i32 %71, ptr %66, align 4, !tbaa !3
  %indvars.iv.next104 = add nuw nsw i64 %indvars.iv103, 1
  %exitcond106.not = icmp eq i64 %indvars.iv103, %52
  br i1 %exitcond106.not, label %._crit_edge88, label %55

._crit_edge88:                                    ; preds = %55, %.lr.ph93
  %72 = load i32, ptr %5, align 4, !tbaa !3
  %73 = call dereferenceable_or_null(40) ptr @malloc(i64 40)
  %74 = load i32, ptr @_QFEc, align 16, !tbaa !3
  %75 = icmp sgt i32 %74, %72
  %76 = zext i1 %75 to i32
  store i32 %76, ptr %73, align 4, !tbaa !3
  %77 = load i32, ptr getelementptr inbounds ([10 x i32], ptr @_QFEc, i64 0, i64 1), align 4, !tbaa !3
  %78 = icmp sgt i32 %77, %72
  %79 = zext i1 %78 to i32
  %80 = getelementptr i32, ptr %73, i64 1
  store i32 %79, ptr %80, align 4, !tbaa !3
  %81 = load i32, ptr getelementptr inbounds ([10 x i32], ptr @_QFEc, i64 0, i64 2), align 8, !tbaa !3
  %82 = icmp sgt i32 %81, %72
  %83 = zext i1 %82 to i32
  %84 = getelementptr i32, ptr %73, i64 2
  store i32 %83, ptr %84, align 4, !tbaa !3
  %85 = load i32, ptr getelementptr inbounds ([10 x i32], ptr @_QFEc, i64 0, i64 3), align 4, !tbaa !3
  %86 = icmp sgt i32 %85, %72
  %87 = zext i1 %86 to i32
  %88 = getelementptr i32, ptr %73, i64 3
  store i32 %87, ptr %88, align 4, !tbaa !3
  %89 = load i32, ptr getelementptr inbounds ([10 x i32], ptr @_QFEc, i64 0, i64 4), align 16, !tbaa !3
  %90 = icmp sgt i32 %89, %72
  %91 = zext i1 %90 to i32
  %92 = getelementptr i32, ptr %73, i64 4
  store i32 %91, ptr %92, align 4, !tbaa !3
  %93 = load i32, ptr getelementptr inbounds ([10 x i32], ptr @_QFEc, i64 0, i64 5), align 4, !tbaa !3
  %94 = icmp sgt i32 %93, %72
  %95 = zext i1 %94 to i32
  %96 = getelementptr i32, ptr %73, i64 5
  store i32 %95, ptr %96, align 4, !tbaa !3
  %97 = load i32, ptr getelementptr inbounds ([10 x i32], ptr @_QFEc, i64 0, i64 6), align 8, !tbaa !3
  %98 = icmp sgt i32 %97, %72
  %99 = zext i1 %98 to i32
  %100 = getelementptr i32, ptr %73, i64 6
  store i32 %99, ptr %100, align 4, !tbaa !3
  %101 = load i32, ptr getelementptr inbounds ([10 x i32], ptr @_QFEc, i64 0, i64 7), align 4, !tbaa !3
  %102 = icmp sgt i32 %101, %72
  %103 = zext i1 %102 to i32
  %104 = getelementptr i32, ptr %73, i64 7
  store i32 %103, ptr %104, align 4, !tbaa !3
  %105 = load i32, ptr getelementptr inbounds ([10 x i32], ptr @_QFEc, i64 0, i64 8), align 16, !tbaa !3
  %106 = icmp sgt i32 %105, %72
  %107 = zext i1 %106 to i32
  %108 = getelementptr i32, ptr %73, i64 8
  store i32 %107, ptr %108, align 4, !tbaa !3
  %109 = load i32, ptr getelementptr inbounds ([10 x i32], ptr @_QFEc, i64 0, i64 9), align 4, !tbaa !3
  %110 = icmp sgt i32 %109, %72
  %111 = zext i1 %110 to i32
  %112 = getelementptr i32, ptr %73, i64 9
  store i32 %111, ptr %112, align 4, !tbaa !3
  store ptr %73, ptr %3, align 8, !tbaa !7
  store i64 4, ptr %.fca.1.gep, align 8, !tbaa !7
  store i32 20180515, ptr %.fca.2.gep, align 8, !tbaa !7
  store i8 1, ptr %.fca.3.gep, align 4, !tbaa !7
  store i8 14, ptr %.fca.4.gep, align 1, !tbaa !7
  store i8 0, ptr %.fca.5.gep, align 2, !tbaa !7
  store i8 0, ptr %.fca.6.gep, align 1, !tbaa !7
  store i64 1, ptr %.fca.7.0.0.gep, align 8, !tbaa !7
  store i64 10, ptr %.fca.7.0.1.gep, align 8, !tbaa !7
  store i64 4, ptr %.fca.7.0.2.gep, align 8, !tbaa !7
  %113 = call i1 @_FortranAAny(ptr nonnull %3, ptr nonnull @_QQcl.2d0a5737d75ea9bd60fe119737e5c977, i32 26, i32 1)
  call void @free(ptr %73)
  br i1 %113, label %114, label %.preheader

114:                                              ; preds = %._crit_edge88
  %115 = load i32, ptr @_QFEc, align 16, !tbaa !3
  %116 = load i32, ptr @_QFEd, align 16, !tbaa !3
  %117 = sub i32 %115, %116
  store i32 %117, ptr @_QFEc, align 16, !tbaa !3
  %118 = load i32, ptr getelementptr inbounds ([10 x i32], ptr @_QFEc, i64 0, i64 1), align 4, !tbaa !3
  %119 = load i32, ptr getelementptr inbounds ([10 x i32], ptr @_QFEd, i64 0, i64 1), align 4, !tbaa !3
  %120 = sub i32 %118, %119
  store i32 %120, ptr getelementptr inbounds ([10 x i32], ptr @_QFEc, i64 0, i64 1), align 4, !tbaa !3
  %121 = load i32, ptr getelementptr inbounds ([10 x i32], ptr @_QFEc, i64 0, i64 2), align 8, !tbaa !3
  %122 = load i32, ptr getelementptr inbounds ([10 x i32], ptr @_QFEd, i64 0, i64 2), align 8, !tbaa !3
  %123 = sub i32 %121, %122
  store i32 %123, ptr getelementptr inbounds ([10 x i32], ptr @_QFEc, i64 0, i64 2), align 8, !tbaa !3
  %124 = load i32, ptr getelementptr inbounds ([10 x i32], ptr @_QFEc, i64 0, i64 3), align 4, !tbaa !3
  %125 = load i32, ptr getelementptr inbounds ([10 x i32], ptr @_QFEd, i64 0, i64 3), align 4, !tbaa !3
  %126 = sub i32 %124, %125
  store i32 %126, ptr getelementptr inbounds ([10 x i32], ptr @_QFEc, i64 0, i64 3), align 4, !tbaa !3
  %127 = load i32, ptr getelementptr inbounds ([10 x i32], ptr @_QFEc, i64 0, i64 4), align 16, !tbaa !3
  %128 = load i32, ptr getelementptr inbounds ([10 x i32], ptr @_QFEd, i64 0, i64 4), align 16, !tbaa !3
  %129 = sub i32 %127, %128
  store i32 %129, ptr getelementptr inbounds ([10 x i32], ptr @_QFEc, i64 0, i64 4), align 16, !tbaa !3
  %130 = load i32, ptr getelementptr inbounds ([10 x i32], ptr @_QFEc, i64 0, i64 5), align 4, !tbaa !3
  %131 = load i32, ptr getelementptr inbounds ([10 x i32], ptr @_QFEd, i64 0, i64 5), align 4, !tbaa !3
  %132 = sub i32 %130, %131
  store i32 %132, ptr getelementptr inbounds ([10 x i32], ptr @_QFEc, i64 0, i64 5), align 4, !tbaa !3
  %133 = load i32, ptr getelementptr inbounds ([10 x i32], ptr @_QFEc, i64 0, i64 6), align 8, !tbaa !3
  %134 = load i32, ptr getelementptr inbounds ([10 x i32], ptr @_QFEd, i64 0, i64 6), align 8, !tbaa !3
  %135 = sub i32 %133, %134
  store i32 %135, ptr getelementptr inbounds ([10 x i32], ptr @_QFEc, i64 0, i64 6), align 8, !tbaa !3
  %136 = load i32, ptr getelementptr inbounds ([10 x i32], ptr @_QFEc, i64 0, i64 7), align 4, !tbaa !3
  %137 = load i32, ptr getelementptr inbounds ([10 x i32], ptr @_QFEd, i64 0, i64 7), align 4, !tbaa !3
  %138 = sub i32 %136, %137
  store i32 %138, ptr getelementptr inbounds ([10 x i32], ptr @_QFEc, i64 0, i64 7), align 4, !tbaa !3
  %139 = load i32, ptr getelementptr inbounds ([10 x i32], ptr @_QFEc, i64 0, i64 8), align 16, !tbaa !3
  %140 = load i32, ptr getelementptr inbounds ([10 x i32], ptr @_QFEd, i64 0, i64 8), align 16, !tbaa !3
  %141 = sub i32 %139, %140
  store i32 %141, ptr getelementptr inbounds ([10 x i32], ptr @_QFEc, i64 0, i64 8), align 16, !tbaa !3
  %142 = load i32, ptr getelementptr inbounds ([10 x i32], ptr @_QFEc, i64 0, i64 9), align 4, !tbaa !3
  %143 = load i32, ptr getelementptr inbounds ([10 x i32], ptr @_QFEd, i64 0, i64 9), align 4, !tbaa !3
  %144 = sub i32 %142, %143
  store i32 %144, ptr getelementptr inbounds ([10 x i32], ptr @_QFEc, i64 0, i64 9), align 4, !tbaa !3
  %145 = load i32, ptr %5, align 4, !tbaa !3
  %146 = call dereferenceable_or_null(40) ptr @malloc(i64 40)
  %147 = icmp sgt i32 %117, %145
  %148 = zext i1 %147 to i32
  store i32 %148, ptr %146, align 4, !tbaa !3
  %149 = icmp sgt i32 %120, %145
  %150 = zext i1 %149 to i32
  %151 = getelementptr i32, ptr %146, i64 1
  store i32 %150, ptr %151, align 4, !tbaa !3
  %152 = icmp sgt i32 %123, %145
  %153 = zext i1 %152 to i32
  %154 = getelementptr i32, ptr %146, i64 2
  store i32 %153, ptr %154, align 4, !tbaa !3
  %155 = icmp sgt i32 %126, %145
  %156 = zext i1 %155 to i32
  %157 = getelementptr i32, ptr %146, i64 3
  store i32 %156, ptr %157, align 4, !tbaa !3
  %158 = icmp sgt i32 %129, %145
  %159 = zext i1 %158 to i32
  %160 = getelementptr i32, ptr %146, i64 4
  store i32 %159, ptr %160, align 4, !tbaa !3
  %161 = icmp sgt i32 %132, %145
  %162 = zext i1 %161 to i32
  %163 = getelementptr i32, ptr %146, i64 5
  store i32 %162, ptr %163, align 4, !tbaa !3
  %164 = icmp sgt i32 %135, %145
  %165 = zext i1 %164 to i32
  %166 = getelementptr i32, ptr %146, i64 6
  store i32 %165, ptr %166, align 4, !tbaa !3
  %167 = icmp sgt i32 %138, %145
  %168 = zext i1 %167 to i32
  %169 = getelementptr i32, ptr %146, i64 7
  store i32 %168, ptr %169, align 4, !tbaa !3
  %170 = icmp sgt i32 %141, %145
  %171 = zext i1 %170 to i32
  %172 = getelementptr i32, ptr %146, i64 8
  store i32 %171, ptr %172, align 4, !tbaa !3
  %173 = icmp sgt i32 %144, %145
  %174 = zext i1 %173 to i32
  %175 = getelementptr i32, ptr %146, i64 9
  store i32 %174, ptr %175, align 4, !tbaa !3
  %176 = add i32 %.091, 1
  store ptr %146, ptr %2, align 8, !tbaa !7
  store i64 4, ptr %.fca.1.gep25, align 8, !tbaa !7
  store i32 20180515, ptr %.fca.2.gep27, align 8, !tbaa !7
  store i8 1, ptr %.fca.3.gep29, align 4, !tbaa !7
  store i8 14, ptr %.fca.4.gep31, align 1, !tbaa !7
  store i8 0, ptr %.fca.5.gep33, align 2, !tbaa !7
  store i8 0, ptr %.fca.6.gep35, align 1, !tbaa !7
  store i64 1, ptr %.fca.7.0.0.gep37, align 8, !tbaa !7
  store i64 10, ptr %.fca.7.0.1.gep39, align 8, !tbaa !7
  store i64 4, ptr %.fca.7.0.2.gep41, align 8, !tbaa !7
  %177 = call i1 @_FortranAAny(ptr nonnull %2, ptr nonnull @_QQcl.2d0a5737d75ea9bd60fe119737e5c977, i32 29, i32 1)
  call void @free(ptr %146)
  br i1 %177, label %select.unfold, label %.preheader

.preheader:                                       ; preds = %._crit_edge88, %114
  %.1.ph = phi i32 [ %.091, %._crit_edge88 ], [ %176, %114 ]
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 16 dereferenceable(40) @_QFEd, ptr noundef nonnull align 16 dereferenceable(40) @_QFEc, i64 40, i1 false), !tbaa !3
  %178 = add nuw i32 %.06689, 1
  %exitcond110.not = icmp eq i32 %.06689, %48
  br i1 %exitcond110.not, label %._crit_edge94, label %.lr.ph93

._crit_edge94:                                    ; preds = %.preheader, %.preheader80
  %.0.lcssa = phi i32 [ %47, %.preheader80 ], [ %.1.ph, %.preheader ]
  %179 = load i32, ptr @_QFEx, align 4, !tbaa !3
  %180 = call i32 @llvm.smin.i32(i32 %179, i32 %.0.lcssa)
  store i32 %180, ptr @_QFEx, align 4, !tbaa !3
  br label %select.unfold

select.unfold:                                    ; preds = %114, %._crit_edge94
  %181 = add nuw i32 %.06596, 1
  %exitcond111.not = icmp eq i32 %181, %spec.select78
  br i1 %exitcond111.not, label %select.unfold._crit_edge, label %.preheader80

select.unfold._crit_edge:                         ; preds = %select.unfold, %._crit_edge84.thread
  %182 = call ptr @_FortranAioBeginExternalFormattedOutput(ptr nonnull @_QQcl.28693029, i64 4, ptr null, i32 -1, ptr nonnull @_QQcl.2d0a5737d75ea9bd60fe119737e5c977, i32 36)
  %183 = load i32, ptr @_QFEx, align 4, !tbaa !3
  %184 = call i1 @_FortranAioOutputInteger32(ptr %182, i32 %183)
  %185 = call i32 @_FortranAioEndIoStatement(ptr %182)
  ret void
}

declare ptr @_FortranAioBeginExternalListInput(i32, ptr, i32) local_unnamed_addr

declare i1 @_FortranAioInputInteger(ptr, ptr, i32) local_unnamed_addr

declare i32 @_FortranAioEndIoStatement(ptr) local_unnamed_addr

declare ptr @_FortranAioBeginExternalFormattedInput(ptr, i64, ptr, i32, ptr, i32) local_unnamed_addr

declare i1 @_FortranAioInputAscii(ptr, ptr, i64) local_unnamed_addr

declare i32 @_FortranACharacterCompareScalar1(ptr, ptr, i64, i64) local_unnamed_addr

declare ptr @_FortranAioBeginExternalFormattedOutput(ptr, i64, ptr, i32, ptr, i32) local_unnamed_addr

declare i1 @_FortranAioOutputInteger32(ptr, i32) local_unnamed_addr

declare {} @_FortranAStopStatement(i32, i1, i1) local_unnamed_addr

declare i1 @_FortranAAny(ptr, ptr, i32, i32) local_unnamed_addr

define linkonce_odr i32 @_FortranASumInteger4x1_contract_simplified(ptr %0) local_unnamed_addr {
  %2 = getelementptr { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, ptr %0, i64 0, i32 7, i64 0, i64 1
  %3 = load i64, ptr %2, align 8, !tbaa !7
  %4 = icmp sgt i64 %3, 0
  br i1 %4, label %.lr.ph, label %._crit_edge

.lr.ph:                                           ; preds = %1
  %5 = load ptr, ptr %0, align 8, !tbaa !7
  %6 = getelementptr { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, ptr %0, i64 0, i32 7, i64 0, i64 2
  %7 = load i64, ptr %6, align 8, !tbaa !7
  %xtraiter = and i64 %3, 3
  %8 = icmp ult i64 %3, 4
  br i1 %8, label %._crit_edge.loopexit.unr-lcssa, label %.lr.ph.new

.lr.ph.new:                                       ; preds = %.lr.ph
  %unroll_iter = and i64 %3, -4
  br label %9

9:                                                ; preds = %9, %.lr.ph.new
  %10 = phi i32 [ 0, %.lr.ph.new ], [ %30, %9 ]
  %11 = phi i64 [ 0, %.lr.ph.new ], [ %31, %9 ]
  %niter = phi i64 [ 0, %.lr.ph.new ], [ %niter.next.3, %9 ]
  %12 = mul i64 %7, %11
  %13 = getelementptr i8, ptr %5, i64 %12
  %14 = load i32, ptr %13, align 4, !tbaa !3
  %15 = add i32 %14, %10
  %16 = or i64 %11, 1
  %17 = mul i64 %7, %16
  %18 = getelementptr i8, ptr %5, i64 %17
  %19 = load i32, ptr %18, align 4, !tbaa !3
  %20 = add i32 %19, %15
  %21 = or i64 %11, 2
  %22 = mul i64 %7, %21
  %23 = getelementptr i8, ptr %5, i64 %22
  %24 = load i32, ptr %23, align 4, !tbaa !3
  %25 = add i32 %24, %20
  %26 = or i64 %11, 3
  %27 = mul i64 %7, %26
  %28 = getelementptr i8, ptr %5, i64 %27
  %29 = load i32, ptr %28, align 4, !tbaa !3
  %30 = add i32 %29, %25
  %31 = add nuw nsw i64 %11, 4
  %niter.next.3 = add i64 %niter, 4
  %niter.ncmp.3 = icmp eq i64 %niter.next.3, %unroll_iter
  br i1 %niter.ncmp.3, label %._crit_edge.loopexit.unr-lcssa, label %9

._crit_edge.loopexit.unr-lcssa:                   ; preds = %9, %.lr.ph
  %.lcssa4.ph = phi i32 [ undef, %.lr.ph ], [ %30, %9 ]
  %.unr = phi i32 [ 0, %.lr.ph ], [ %30, %9 ]
  %.unr5 = phi i64 [ 0, %.lr.ph ], [ %31, %9 ]
  %lcmp.mod.not = icmp eq i64 %xtraiter, 0
  br i1 %lcmp.mod.not, label %._crit_edge, label %.epil.preheader

.epil.preheader:                                  ; preds = %._crit_edge.loopexit.unr-lcssa, %.epil.preheader
  %32 = phi i32 [ %37, %.epil.preheader ], [ %.unr, %._crit_edge.loopexit.unr-lcssa ]
  %33 = phi i64 [ %38, %.epil.preheader ], [ %.unr5, %._crit_edge.loopexit.unr-lcssa ]
  %epil.iter = phi i64 [ %epil.iter.next, %.epil.preheader ], [ 0, %._crit_edge.loopexit.unr-lcssa ]
  %34 = mul i64 %7, %33
  %35 = getelementptr i8, ptr %5, i64 %34
  %36 = load i32, ptr %35, align 4, !tbaa !3
  %37 = add i32 %36, %32
  %38 = add nuw nsw i64 %33, 1
  %epil.iter.next = add i64 %epil.iter, 1
  %epil.iter.cmp.not = icmp eq i64 %epil.iter.next, %xtraiter
  br i1 %epil.iter.cmp.not, label %._crit_edge, label %.epil.preheader, !llvm.loop !10

._crit_edge:                                      ; preds = %._crit_edge.loopexit.unr-lcssa, %.epil.preheader, %1
  %.lcssa = phi i32 [ 0, %1 ], [ %.lcssa4.ph, %._crit_edge.loopexit.unr-lcssa ], [ %37, %.epil.preheader ]
  ret i32 %.lcssa
}

; Function Attrs: mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.ctpop.i32(i32) #2

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smin.i32(i32, i32) #3

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smax.i32(i32, i32) #3

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

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #5

attributes #0 = { mustprogress nofree nounwind willreturn allockind("alloc,uninitialized") allocsize(0) memory(inaccessiblemem: readwrite) "alloc-family"="malloc" }
attributes #1 = { mustprogress nounwind willreturn allockind("free") memory(argmem: readwrite, inaccessiblemem: readwrite) "alloc-family"="malloc" }
attributes #2 = { mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #3 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #4 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #5 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }

!llvm.module.flags = !{!0, !1, !2}

!0 = !{i32 2, !"Debug Info Version", i32 3}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{!4, !4, i64 0}
!4 = !{!"any data access", !5, i64 0}
!5 = !{!"any access", !6, i64 0}
!6 = !{!"Flang Type TBAA Root"}
!7 = !{!8, !8, i64 0}
!8 = !{!"descriptor member", !5, i64 0}
!9 = !{i32 0, i32 33}
!10 = distinct !{!10, !11}
!11 = !{!"llvm.loop.unroll.disable"}
