implicit none
integer :: n,d
integer,allocatable :: x(:,:),dx(:)
integer :: i,j,k,z

read *,n,d
allocate(x(d,n))
do i = 1, n
   read *,(x(j,i),j=1,d)
enddo

allocate(dx(d))

k = 0
do i = 1, n-1
   do j = i+1, n
      dx(:) = x(:,i) - x(:,j)
      z = dot_product(dx,dx)
      if (z == int(sqrt(real(z,kind=8)))**2) then
         k = k + 1
      endif
   enddo
enddo

print '(i0)',k
end
; 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"

@_QFEdx = internal unnamed_addr global { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] } { ptr null, i64 ptrtoint (ptr getelementptr (i32, ptr null, i32 1) to i64), i32 20180515, i8 1, i8 9, i8 2, i8 0, [1 x [3 x i64]] [[3 x i64] [i64 1, i64 0, i64 ptrtoint (ptr getelementptr (i32, ptr null, i32 1) to i64)]] }
@_QFEx.0 = internal unnamed_addr global ptr null
@_QFEx.8 = internal unnamed_addr global i64 0
@_QQcl.770c1afb26d8bdbf2cdf40ae7464bffe = linkonce constant [73 x i8] c"/home/ubuntu/Downloads/TheStack_IR/Collated/Fortran/Source_3790/source.f\00"
@_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

define void @_QQmain() local_unnamed_addr {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = tail call ptr @_FortranAioBeginExternalListInput(i32 -1, ptr nonnull @_QQcl.770c1afb26d8bdbf2cdf40ae7464bffe, i32 6)
  %4 = call i1 @_FortranAioInputInteger(ptr %3, ptr nonnull %2, i32 4)
  %5 = call i1 @_FortranAioInputInteger(ptr %3, ptr nonnull %1, i32 4)
  %6 = call i32 @_FortranAioEndIoStatement(ptr %3)
  %7 = load i32, ptr %1, align 4, !tbaa !3
  %8 = load i32, ptr %2, align 4, !tbaa !3
  %9 = call i32 @llvm.smax.i32(i32 %7, i32 0)
  %10 = zext i32 %9 to i64
  %11 = call i32 @llvm.smax.i32(i32 %8, i32 0)
  %12 = zext i32 %11 to i64
  %13 = shl nuw nsw i64 %10, 2
  %14 = mul nuw i64 %13, %12
  %15 = call ptr @malloc(i64 %14)
  store ptr %15, ptr @_QFEx.0, align 8, !tbaa !7
  store i64 %10, ptr @_QFEx.8, align 8, !tbaa !7
  %16 = icmp sgt i32 %8, 0
  br i1 %16, label %.lr.ph257.preheader, label %._crit_edge258

.lr.ph257.preheader:                              ; preds = %0
  %17 = zext i32 %8 to i64
  br label %.lr.ph257

.lr.ph257:                                        ; preds = %.lr.ph257.preheader, %._crit_edge
  %indvars.iv = phi i64 [ 1, %.lr.ph257.preheader ], [ %indvars.iv.next, %._crit_edge ]
  %18 = call ptr @_FortranAioBeginExternalListInput(i32 -1, ptr nonnull @_QQcl.770c1afb26d8bdbf2cdf40ae7464bffe, i32 9)
  %19 = load i32, ptr %1, align 4, !tbaa !3
  %20 = icmp sgt i32 %19, 0
  br i1 %20, label %.lr.ph, label %._crit_edge

.lr.ph:                                           ; preds = %.lr.ph257
  %21 = zext i32 %19 to i64
  %22 = add nsw i64 %indvars.iv, -1
  br label %23

23:                                               ; preds = %.lr.ph, %23
  %24 = phi i64 [ 1, %.lr.ph ], [ %31, %23 ]
  %.unpack238 = load ptr, ptr @_QFEx.0, align 8, !tbaa !7
  %.unpack245.unpack.unpack248 = load i64, ptr @_QFEx.8, align 8, !tbaa !7
  %sext = shl i64 %24, 32
  %25 = ashr exact i64 %sext, 32
  %26 = add nsw i64 %25, -1
  %27 = mul i64 %22, %.unpack245.unpack.unpack248
  %28 = add i64 %26, %27
  %29 = getelementptr i32, ptr %.unpack238, i64 %28
  %30 = call i1 @_FortranAioInputInteger(ptr %18, ptr %29, i32 4)
  %31 = add nuw nsw i64 %24, 1
  %exitcond.not = icmp eq i64 %24, %21
  br i1 %exitcond.not, label %._crit_edge, label %23

._crit_edge:                                      ; preds = %23, %.lr.ph257
  %32 = call i32 @_FortranAioEndIoStatement(ptr %18)
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %exitcond292.not = icmp eq i64 %indvars.iv, %17
  br i1 %exitcond292.not, label %._crit_edge258.loopexit, label %.lr.ph257

._crit_edge258.loopexit:                          ; preds = %._crit_edge
  %.pre = load i32, ptr %1, align 4, !tbaa !3
  %.pre311 = load i32, ptr %2, align 4, !tbaa !3
  br label %._crit_edge258

._crit_edge258:                                   ; preds = %._crit_edge258.loopexit, %0
  %33 = phi i32 [ %.pre311, %._crit_edge258.loopexit ], [ %8, %0 ]
  %34 = phi i32 [ %.pre, %._crit_edge258.loopexit ], [ %7, %0 ]
  %.fr286 = freeze i32 %34
  %35 = call i32 @llvm.smax.i32(i32 %.fr286, i32 0)
  %36 = zext i32 %35 to i64
  %37 = shl nuw nsw i64 %36, 2
  %38 = call ptr @malloc(i64 %37)
  %39 = ptrtoint ptr %38 to i64
  store ptr %38, ptr @_QFEdx, align 16, !tbaa !7
  store i64 4, ptr getelementptr inbounds ({ ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, ptr @_QFEdx, i64 0, i32 1), align 8, !tbaa !7
  store i32 20180515, ptr getelementptr inbounds ({ ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, ptr @_QFEdx, i64 0, i32 2), align 16, !tbaa !7
  store i8 1, ptr getelementptr inbounds ({ ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, ptr @_QFEdx, i64 0, i32 3), align 4, !tbaa !7
  store i8 9, ptr getelementptr inbounds ({ ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, ptr @_QFEdx, i64 0, i32 4), align 1, !tbaa !7
  store i8 2, ptr getelementptr inbounds ({ ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, ptr @_QFEdx, i64 0, i32 5), align 2, !tbaa !7
  store i8 0, ptr getelementptr inbounds ({ ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, ptr @_QFEdx, i64 0, i32 6), align 1, !tbaa !7
  store i64 1, ptr getelementptr inbounds ({ ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, ptr @_QFEdx, i64 0, i32 7), align 8, !tbaa !7
  store i64 %36, ptr getelementptr inbounds ({ ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, ptr @_QFEdx, i64 0, i32 7, i64 0, i64 1), align 16, !tbaa !7
  store i64 4, ptr getelementptr inbounds ({ ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, ptr @_QFEdx, i64 0, i32 7, i64 0, i64 2), align 8, !tbaa !7
  %40 = add i32 %33, -1
  %41 = sext i32 %40 to i64
  %42 = icmp sgt i32 %40, 0
  br i1 %42, label %.lr.ph274, label %._crit_edge275

.lr.ph274:                                        ; preds = %._crit_edge258
  %43 = sext i32 %33 to i64
  %.unpack210 = load ptr, ptr @_QFEx.0, align 8
  %.unpack210344 = ptrtoint ptr %.unpack210 to i64
  %.unpack217.unpack.unpack220 = load i64, ptr @_QFEx.8, align 8
  %44 = icmp sgt i32 %.fr286, 0
  br i1 %44, label %.lr.ph274.split.us.split.preheader, label %.lr.ph274.split.split.us.preheader

.lr.ph274.split.split.us.preheader:               ; preds = %.lr.ph274
  %min.iters.check = icmp ult i32 %40, 8
  br i1 %min.iters.check, label %.lr.ph274.split.split.us.preheader370, label %vector.ph

vector.ph:                                        ; preds = %.lr.ph274.split.split.us.preheader
  %n.vec = and i64 %41, -8
  %ind.end = or i64 %n.vec, 1
  %.cast = trunc i64 %n.vec to i32
  %ind.end318 = sub i32 %40, %.cast
  %.splatinsert = insertelement <4 x i32> poison, i32 %40, i64 0
  %.splat = shufflevector <4 x i32> %.splatinsert, <4 x i32> poison, <4 x i32> zeroinitializer
  %induction = add <4 x i32> %.splat, <i32 0, i32 -1, i32 -2, i32 -3>
  %broadcast.splatinsert = insertelement <4 x i64> poison, i64 %43, i64 0
  %broadcast.splat = shufflevector <4 x i64> %broadcast.splatinsert, <4 x i64> poison, <4 x i32> zeroinitializer
  %broadcast.splatinsert326 = insertelement <4 x i64> poison, i64 %43, i64 0
  %broadcast.splat327 = shufflevector <4 x i64> %broadcast.splatinsert326, <4 x i64> poison, <4 x i32> zeroinitializer
  br label %vector.body

vector.body:                                      ; preds = %vector.body, %vector.ph
  %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
  %vec.ind = phi <4 x i64> [ <i64 1, i64 2, i64 3, i64 4>, %vector.ph ], [ %vec.ind.next, %vector.body ]
  %vec.ind321 = phi <4 x i32> [ %induction, %vector.ph ], [ %vec.ind.next324, %vector.body ]
  %vec.phi = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %59, %vector.body ]
  %vec.phi325 = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %60, %vector.body ]
  %step.add322 = add <4 x i32> %vec.ind321, <i32 -4, i32 -4, i32 -4, i32 -4>
  %45 = shl <4 x i64> %vec.ind, <i64 32, i64 32, i64 32, i64 32>
  %46 = add <4 x i64> %45, <i64 4294967296, i64 4294967296, i64 4294967296, i64 4294967296>
  %47 = shl <4 x i64> %vec.ind, <i64 32, i64 32, i64 32, i64 32>
  %48 = add <4 x i64> %47, <i64 21474836480, i64 21474836480, i64 21474836480, i64 21474836480>
  %49 = ashr exact <4 x i64> %46, <i64 32, i64 32, i64 32, i64 32>
  %50 = ashr exact <4 x i64> %48, <i64 32, i64 32, i64 32, i64 32>
  %51 = sub nsw <4 x i64> <i64 1, i64 1, i64 1, i64 1>, %49
  %52 = sub nsw <4 x i64> <i64 1, i64 1, i64 1, i64 1>, %50
  %53 = add nsw <4 x i64> %51, %broadcast.splat
  %54 = add nsw <4 x i64> %52, %broadcast.splat327
  %55 = icmp sgt <4 x i64> %53, zeroinitializer
  %56 = icmp sgt <4 x i64> %54, zeroinitializer
  %57 = select <4 x i1> %55, <4 x i32> %vec.ind321, <4 x i32> zeroinitializer
  %58 = select <4 x i1> %56, <4 x i32> %step.add322, <4 x i32> zeroinitializer
  %59 = add <4 x i32> %vec.phi, %57
  %60 = add <4 x i32> %vec.phi325, %58
  %index.next = add nuw i64 %index, 8
  %vec.ind.next = add <4 x i64> %vec.ind, <i64 8, i64 8, i64 8, i64 8>
  %vec.ind.next324 = add <4 x i32> %vec.ind321, <i32 -8, i32 -8, i32 -8, i32 -8>
  %61 = icmp eq i64 %index.next, %n.vec
  br i1 %61, label %middle.block, label %vector.body, !llvm.loop !9

middle.block:                                     ; preds = %vector.body
  %bin.rdx = add <4 x i32> %60, %59
  %62 = call i32 @llvm.vector.reduce.add.v4i32(<4 x i32> %bin.rdx)
  %cmp.n = icmp eq i64 %n.vec, %41
  br i1 %cmp.n, label %._crit_edge275, label %.lr.ph274.split.split.us.preheader370

.lr.ph274.split.split.us.preheader370:            ; preds = %.lr.ph274.split.split.us.preheader, %middle.block
  %indvars.iv299.ph = phi i64 [ 1, %.lr.ph274.split.split.us.preheader ], [ %ind.end, %middle.block ]
  %indvars.iv297.ph = phi i32 [ %40, %.lr.ph274.split.split.us.preheader ], [ %ind.end318, %middle.block ]
  %.0272.us278.ph = phi i32 [ 0, %.lr.ph274.split.split.us.preheader ], [ %62, %middle.block ]
  br label %.lr.ph274.split.split.us

.lr.ph274.split.us.split.preheader:               ; preds = %.lr.ph274
  %63 = shl i64 %.unpack217.unpack.unpack220, 2
  %64 = shl i64 %.unpack217.unpack.unpack220, 2
  %65 = call i64 @llvm.smax.i64(i64 %36, i64 1)
  %min.iters.check348 = icmp ult i64 %65, 8
  %n.vec351 = and i64 %65, 2147483640
  %ind.end352 = sub nsw i64 %36, %n.vec351
  %cmp.n355 = icmp eq i64 %65, %n.vec351
  %min.iters.check330 = icmp ult i32 %35, 8
  %n.vec333 = and i64 %36, 2147483640
  %cmp.n335 = icmp eq i64 %n.vec333, %36
  br label %.lr.ph274.split.us.split

.lr.ph274.split.us.split:                         ; preds = %.lr.ph274.split.us.split.preheader, %._crit_edge265.split.us.us.split
  %indvar = phi i64 [ 0, %.lr.ph274.split.us.split.preheader ], [ %indvar.next, %._crit_edge265.split.us.us.split ]
  %indvars.iv303 = phi i64 [ 1, %.lr.ph274.split.us.split.preheader ], [ %indvars.iv.next304, %._crit_edge265.split.us.us.split ]
  %.0272.us = phi i32 [ 0, %.lr.ph274.split.us.split.preheader ], [ %.1.lcssa.us, %._crit_edge265.split.us.us.split ]
  %66 = mul i64 %64, %indvar
  %67 = add i64 %66, %.unpack210344
  %indvars.iv.next304 = add nuw nsw i64 %indvars.iv303, 1
  %sext314 = shl i64 %indvars.iv.next304, 32
  %68 = ashr exact i64 %sext314, 32
  %69 = sub nsw i64 1, %68
  %70 = add nsw i64 %69, %43
  %71 = icmp sgt i64 %70, 0
  br i1 %71, label %.lr.ph264.us, label %._crit_edge265.split.us.us.split

._crit_edge265.split.us.us.split:                 ; preds = %_FortranADotProductInteger4_contract_i32_i32_simplified.exit.loopexit.us.us, %.lr.ph274.split.us.split
  %.1.lcssa.us = phi i32 [ %.0272.us, %.lr.ph274.split.us.split ], [ %spec.select.us.us, %_FortranADotProductInteger4_contract_i32_i32_simplified.exit.loopexit.us.us ]
  %exitcond306.not = icmp eq i64 %indvars.iv303, %41
  %indvar.next = add i64 %indvar, 1
  br i1 %exitcond306.not, label %._crit_edge275, label %.lr.ph274.split.us.split

.lr.ph264.us:                                     ; preds = %.lr.ph274.split.us.split
  %72 = trunc i64 %indvars.iv.next304 to i32
  %73 = add nsw i64 %indvars.iv303, -1
  %74 = mul i64 %73, %.unpack217.unpack.unpack220
  %75 = sub i64 %39, %67
  %diff.check345 = icmp ult i64 %75, 32
  br label %.lr.ph260.us.us

.lr.ph260.us.us:                                  ; preds = %_FortranADotProductInteger4_contract_i32_i32_simplified.exit.loopexit.us.us, %.lr.ph264.us
  %76 = phi i64 [ %70, %.lr.ph264.us ], [ %134, %_FortranADotProductInteger4_contract_i32_i32_simplified.exit.loopexit.us.us ]
  %77 = phi i32 [ %72, %.lr.ph264.us ], [ %133, %_FortranADotProductInteger4_contract_i32_i32_simplified.exit.loopexit.us.us ]
  %.1262.us.us = phi i32 [ %.0272.us, %.lr.ph264.us ], [ %spec.select.us.us, %_FortranADotProductInteger4_contract_i32_i32_simplified.exit.loopexit.us.us ]
  %78 = sext i32 %77 to i64
  %79 = add nsw i64 %78, -1
  %80 = mul i64 %79, %.unpack217.unpack.unpack220
  br i1 %min.iters.check348, label %scalar.ph347.preheader, label %vector.memcheck

vector.memcheck:                                  ; preds = %.lr.ph260.us.us
  %81 = sext i32 %77 to i64
  %82 = add nsw i64 %81, -1
  %83 = mul i64 %63, %82
  %84 = add i64 %83, %.unpack210344
  %85 = sub i64 %39, %84
  %diff.check = icmp ult i64 %85, 32
  %conflict.rdx = or i1 %diff.check, %diff.check345
  br i1 %conflict.rdx, label %scalar.ph347.preheader, label %vector.body356

vector.body356:                                   ; preds = %vector.memcheck, %vector.body356
  %index357 = phi i64 [ %index.next362, %vector.body356 ], [ 0, %vector.memcheck ]
  %86 = add i64 %index357, %74
  %87 = getelementptr i32, ptr %.unpack210, i64 %86
  %wide.load358 = load <4 x i32>, ptr %87, align 4, !tbaa !3
  %88 = getelementptr i32, ptr %87, i64 4
  %wide.load359 = load <4 x i32>, ptr %88, align 4, !tbaa !3
  %89 = add i64 %index357, %80
  %90 = getelementptr i32, ptr %.unpack210, i64 %89
  %wide.load360 = load <4 x i32>, ptr %90, align 4, !tbaa !3
  %91 = getelementptr i32, ptr %90, i64 4
  %wide.load361 = load <4 x i32>, ptr %91, align 4, !tbaa !3
  %92 = sub <4 x i32> %wide.load358, %wide.load360
  %93 = sub <4 x i32> %wide.load359, %wide.load361
  %94 = getelementptr i32, ptr %38, i64 %index357
  store <4 x i32> %92, ptr %94, align 4, !tbaa !3
  %95 = getelementptr i32, ptr %94, i64 4
  store <4 x i32> %93, ptr %95, align 4, !tbaa !3
  %index.next362 = add nuw i64 %index357, 8
  %96 = icmp eq i64 %index.next362, %n.vec351
  br i1 %96, label %middle.block346, label %vector.body356, !llvm.loop !12

middle.block346:                                  ; preds = %vector.body356
  br i1 %cmp.n355, label %.lr.ph.i.us.us.preheader, label %scalar.ph347.preheader

scalar.ph347.preheader:                           ; preds = %vector.memcheck, %.lr.ph260.us.us, %middle.block346
  %.ph365 = phi i64 [ %36, %vector.memcheck ], [ %36, %.lr.ph260.us.us ], [ %ind.end352, %middle.block346 ]
  %.ph366 = phi i64 [ 0, %vector.memcheck ], [ 0, %.lr.ph260.us.us ], [ %n.vec351, %middle.block346 ]
  br label %scalar.ph347

.lr.ph.i.us.us:                                   ; preds = %.lr.ph.i.us.us.preheader363, %.lr.ph.i.us.us
  %97 = phi i32 [ %103, %.lr.ph.i.us.us ], [ %.ph, %.lr.ph.i.us.us.preheader363 ]
  %98 = phi i64 [ %104, %.lr.ph.i.us.us ], [ %.ph364, %.lr.ph.i.us.us.preheader363 ]
  %99 = shl i64 %98, 2
  %100 = getelementptr i8, ptr %38, i64 %99
  %101 = load i32, ptr %100, align 4, !tbaa !3
  %102 = mul i32 %101, %101
  %103 = add i32 %102, %97
  %104 = add nuw nsw i64 %98, 1
  %exitcond.not.i.us.us = icmp eq i64 %104, %36
  br i1 %exitcond.not.i.us.us, label %_FortranADotProductInteger4_contract_i32_i32_simplified.exit.loopexit.us.us, label %.lr.ph.i.us.us, !llvm.loop !13

scalar.ph347:                                     ; preds = %scalar.ph347.preheader, %scalar.ph347
  %105 = phi i64 [ %116, %scalar.ph347 ], [ %.ph365, %scalar.ph347.preheader ]
  %106 = phi i64 [ %115, %scalar.ph347 ], [ %.ph366, %scalar.ph347.preheader ]
  %107 = add i64 %106, %74
  %108 = getelementptr i32, ptr %.unpack210, i64 %107
  %109 = load i32, ptr %108, align 4, !tbaa !3
  %110 = add i64 %106, %80
  %111 = getelementptr i32, ptr %.unpack210, i64 %110
  %112 = load i32, ptr %111, align 4, !tbaa !3
  %113 = sub i32 %109, %112
  %114 = getelementptr i32, ptr %38, i64 %106
  store i32 %113, ptr %114, align 4, !tbaa !3
  %115 = add nuw nsw i64 %106, 1
  %116 = add nsw i64 %105, -1
  %117 = icmp sgt i64 %105, 1
  br i1 %117, label %scalar.ph347, label %.lr.ph.i.us.us.preheader, !llvm.loop !14

.lr.ph.i.us.us.preheader:                         ; preds = %scalar.ph347, %middle.block346
  br i1 %min.iters.check330, label %.lr.ph.i.us.us.preheader363, label %vector.body336

vector.body336:                                   ; preds = %.lr.ph.i.us.us.preheader, %vector.body336
  %index337 = phi i64 [ %index.next341, %vector.body336 ], [ 0, %.lr.ph.i.us.us.preheader ]
  %vec.phi338 = phi <4 x i32> [ %123, %vector.body336 ], [ zeroinitializer, %.lr.ph.i.us.us.preheader ]
  %vec.phi339 = phi <4 x i32> [ %124, %vector.body336 ], [ zeroinitializer, %.lr.ph.i.us.us.preheader ]
  %118 = shl i64 %index337, 2
  %119 = getelementptr i8, ptr %38, i64 %118
  %wide.load = load <4 x i32>, ptr %119, align 4, !tbaa !3
  %120 = getelementptr i32, ptr %119, i64 4
  %wide.load340 = load <4 x i32>, ptr %120, align 4, !tbaa !3
  %121 = mul <4 x i32> %wide.load, %wide.load
  %122 = mul <4 x i32> %wide.load340, %wide.load340
  %123 = add <4 x i32> %121, %vec.phi338
  %124 = add <4 x i32> %122, %vec.phi339
  %index.next341 = add nuw i64 %index337, 8
  %125 = icmp eq i64 %index.next341, %n.vec333
  br i1 %125, label %middle.block328, label %vector.body336, !llvm.loop !15

middle.block328:                                  ; preds = %vector.body336
  %bin.rdx342 = add <4 x i32> %124, %123
  %126 = call i32 @llvm.vector.reduce.add.v4i32(<4 x i32> %bin.rdx342)
  br i1 %cmp.n335, label %_FortranADotProductInteger4_contract_i32_i32_simplified.exit.loopexit.us.us, label %.lr.ph.i.us.us.preheader363

.lr.ph.i.us.us.preheader363:                      ; preds = %.lr.ph.i.us.us.preheader, %middle.block328
  %.ph = phi i32 [ 0, %.lr.ph.i.us.us.preheader ], [ %126, %middle.block328 ]
  %.ph364 = phi i64 [ 0, %.lr.ph.i.us.us.preheader ], [ %n.vec333, %middle.block328 ]
  br label %.lr.ph.i.us.us

_FortranADotProductInteger4_contract_i32_i32_simplified.exit.loopexit.us.us: ; preds = %.lr.ph.i.us.us, %middle.block328
  %.lcssa = phi i32 [ %126, %middle.block328 ], [ %103, %.lr.ph.i.us.us ]
  %127 = sitofp i32 %.lcssa to double
  %128 = call contract double @llvm.sqrt.f64(double %127)
  %129 = fptosi double %128 to i32
  %130 = mul i32 %129, %129
  %131 = icmp eq i32 %.lcssa, %130
  %132 = zext i1 %131 to i32
  %spec.select.us.us = add i32 %.1262.us.us, %132
  %133 = add i32 %77, 1
  %134 = add i64 %76, -1
  %135 = icmp sgt i64 %134, 0
  br i1 %135, label %.lr.ph260.us.us, label %._crit_edge265.split.us.us.split

.lr.ph274.split.split.us:                         ; preds = %.lr.ph274.split.split.us.preheader370, %.lr.ph274.split.split.us
  %indvars.iv299 = phi i64 [ %indvars.iv.next300, %.lr.ph274.split.split.us ], [ %indvars.iv299.ph, %.lr.ph274.split.split.us.preheader370 ]
  %indvars.iv297 = phi i32 [ %indvars.iv.next298, %.lr.ph274.split.split.us ], [ %indvars.iv297.ph, %.lr.ph274.split.split.us.preheader370 ]
  %.0272.us278 = phi i32 [ %spec.select, %.lr.ph274.split.split.us ], [ %.0272.us278.ph, %.lr.ph274.split.split.us.preheader370 ]
  %indvars.iv.next300 = add nuw nsw i64 %indvars.iv299, 1
  %sext313 = shl i64 %indvars.iv.next300, 32
  %136 = ashr exact i64 %sext313, 32
  %137 = sub nsw i64 1, %136
  %138 = add nsw i64 %137, %43
  %139 = icmp sgt i64 %138, 0
  %140 = select i1 %139, i32 %indvars.iv297, i32 0
  %spec.select = add i32 %.0272.us278, %140
  %indvars.iv.next298 = add i32 %indvars.iv297, -1
  %exitcond302.not = icmp eq i64 %indvars.iv299, %41
  br i1 %exitcond302.not, label %._crit_edge275, label %.lr.ph274.split.split.us, !llvm.loop !16

._crit_edge275:                                   ; preds = %.lr.ph274.split.split.us, %._crit_edge265.split.us.us.split, %middle.block, %._crit_edge258
  %.0.lcssa = phi i32 [ 0, %._crit_edge258 ], [ %62, %middle.block ], [ %.1.lcssa.us, %._crit_edge265.split.us.us.split ], [ %spec.select, %.lr.ph274.split.split.us ]
  %141 = call ptr @_FortranAioBeginExternalFormattedOutput(ptr nonnull @_QQcl.28693029, i64 4, ptr null, i32 -1, ptr nonnull @_QQcl.770c1afb26d8bdbf2cdf40ae7464bffe, i32 25)
  %142 = call i1 @_FortranAioOutputInteger32(ptr %141, i32 %.0.lcssa)
  %143 = call i32 @_FortranAioEndIoStatement(ptr %141)
  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 @_FortranAioBeginExternalFormattedOutput(ptr, i64, ptr, i32, ptr, i32) local_unnamed_addr

declare i1 @_FortranAioOutputInteger32(ptr, i32) local_unnamed_addr

; Function Attrs: mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare double @llvm.sqrt.f64(double) #1

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

; Function Attrs: nocallback nofree nosync nounwind willreturn memory(none)
declare i32 @llvm.vector.reduce.add.v4i32(<4 x i32>) #3

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

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

!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 = distinct !{!9, !10, !11}
!10 = !{!"llvm.loop.isvectorized", i32 1}
!11 = !{!"llvm.loop.unroll.runtime.disable"}
!12 = distinct !{!12, !10, !11}
!13 = distinct !{!13, !11, !10}
!14 = distinct !{!14, !10}
!15 = distinct !{!15, !10, !11}
!16 = distinct !{!16, !11, !10}
