program ABC162_B
  integer(8),dimension(15)::X,Y
  integer(8)::A,N,M
  X=(/1,2,0,4,0,0,7,8,0,0,11,0,13,14,0/)
  Y=(/1,1,0,1,0,0,1,1,0,0,1,0,1,1,0/)
  read(5,*)N
  M=N/15
  L=mod(N,15)
  if(N>=1) then
     A=60*M*M+15*M*sum(Y(1:L)) + sum(X(1:L))
  else
     A=60*(M**2)
  end if
  write(6,*)A
end program ABC162_B
; 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"

@_QFEx = internal unnamed_addr global [15 x i64] undef
@_QFEy = internal unnamed_addr global [15 x i64] undef
@_QQro.15xi8.cafa14e4c405107f6fc3e86de206a1aa = internal unnamed_addr constant [15 x i64] [i64 1, i64 2, i64 0, i64 4, i64 0, i64 0, i64 7, i64 8, i64 0, i64 0, i64 11, i64 0, i64 13, i64 14, i64 0]
@_QQro.15xi8.3fa6ec6ee462132773a79d385f738d88 = internal unnamed_addr constant [15 x i64] [i64 1, i64 1, i64 0, i64 1, i64 0, i64 0, i64 1, i64 1, i64 0, i64 0, i64 1, i64 0, i64 1, i64 1, i64 0]
@_QQcl.fd7a9ffcea622bf11173b91cf070a8ed = linkonce constant [73 x i8] c"/home/ubuntu/Downloads/TheStack_IR/Collated/Fortran/Source_1788/source.f\00"
@_QQEnvironmentDefaults = local_unnamed_addr constant ptr null

define void @_QQmain() local_unnamed_addr {
.preheader.preheader:
  %0 = alloca i64, align 8
  tail call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 16 dereferenceable(120) @_QFEx, ptr noundef nonnull align 16 dereferenceable(120) @_QQro.15xi8.cafa14e4c405107f6fc3e86de206a1aa, i64 120, i1 false), !tbaa !3
  tail call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 16 dereferenceable(120) @_QFEy, ptr noundef nonnull align 16 dereferenceable(120) @_QQro.15xi8.3fa6ec6ee462132773a79d385f738d88, i64 120, i1 false), !tbaa !3
  %1 = tail call ptr @_FortranAioBeginExternalListInput(i32 5, ptr nonnull @_QQcl.fd7a9ffcea622bf11173b91cf070a8ed, i32 6)
  %2 = call i1 @_FortranAioInputInteger(ptr %1, ptr nonnull %0, i32 8)
  %3 = call i32 @_FortranAioEndIoStatement(ptr %1)
  %4 = load i64, ptr %0, align 8, !tbaa !3
  %5 = sdiv i64 %4, 15
  %6 = icmp sgt i64 %4, 0
  br i1 %6, label %7, label %44

7:                                                ; preds = %.preheader.preheader
  %8 = urem i64 %4, 15
  %9 = mul i64 %5, %5
  %10 = mul i64 %9, 60
  %11 = mul nsw i64 %5, 15
  %.not = icmp eq i64 %8, 0
  br i1 %.not, label %_FortranASumInteger8x1_contract_simplified.exit30, label %.lr.ph.i.preheader

.lr.ph.i.preheader:                               ; preds = %7
  %min.iters.check = icmp ult i64 %8, 4
  br i1 %min.iters.check, label %.lr.ph.i.preheader69, label %vector.ph

vector.ph:                                        ; preds = %.lr.ph.i.preheader
  %n.vec = and i64 %8, 12
  br label %vector.body

vector.body:                                      ; preds = %vector.body, %vector.ph
  %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
  %vec.phi = phi <2 x i64> [ zeroinitializer, %vector.ph ], [ %15, %vector.body ]
  %vec.phi46 = phi <2 x i64> [ zeroinitializer, %vector.ph ], [ %16, %vector.body ]
  %12 = shl i64 %index, 3
  %13 = getelementptr i8, ptr @_QFEy, i64 %12
  %wide.load = load <2 x i64>, ptr %13, align 16, !tbaa !3
  %14 = getelementptr i64, ptr %13, i64 2
  %wide.load47 = load <2 x i64>, ptr %14, align 16, !tbaa !3
  %15 = add <2 x i64> %wide.load, %vec.phi
  %16 = add <2 x i64> %wide.load47, %vec.phi46
  %index.next = add nuw i64 %index, 4
  %17 = icmp eq i64 %index.next, %n.vec
  br i1 %17, label %middle.block, label %vector.body, !llvm.loop !7

middle.block:                                     ; preds = %vector.body
  %bin.rdx = add <2 x i64> %16, %15
  %18 = call i64 @llvm.vector.reduce.add.v2i64(<2 x i64> %bin.rdx)
  %cmp.n = icmp eq i64 %8, %n.vec
  br i1 %cmp.n, label %.lr.ph.i27.preheader, label %.lr.ph.i.preheader69

.lr.ph.i.preheader69:                             ; preds = %.lr.ph.i.preheader, %middle.block
  %.ph70 = phi i64 [ 0, %.lr.ph.i.preheader ], [ %18, %middle.block ]
  %.ph71 = phi i64 [ 0, %.lr.ph.i.preheader ], [ %n.vec, %middle.block ]
  br label %.lr.ph.i

.lr.ph.i:                                         ; preds = %.lr.ph.i.preheader69, %.lr.ph.i
  %19 = phi i64 [ %24, %.lr.ph.i ], [ %.ph70, %.lr.ph.i.preheader69 ]
  %20 = phi i64 [ %25, %.lr.ph.i ], [ %.ph71, %.lr.ph.i.preheader69 ]
  %21 = shl i64 %20, 3
  %22 = getelementptr i8, ptr @_QFEy, i64 %21
  %23 = load i64, ptr %22, align 8, !tbaa !3
  %24 = add i64 %23, %19
  %25 = add nuw nsw i64 %20, 1
  %exitcond.not.i = icmp eq i64 %25, %8
  br i1 %exitcond.not.i, label %.lr.ph.i27.preheader, label %.lr.ph.i, !llvm.loop !10

.lr.ph.i27.preheader:                             ; preds = %.lr.ph.i, %middle.block
  %.lcssa45 = phi i64 [ %18, %middle.block ], [ %24, %.lr.ph.i ]
  %26 = mul i64 %11, %.lcssa45
  %27 = add i64 %26, %10
  %min.iters.check50 = icmp ult i64 %8, 4
  br i1 %min.iters.check50, label %.lr.ph.i27.preheader65, label %vector.ph51

vector.ph51:                                      ; preds = %.lr.ph.i27.preheader
  %n.vec53 = and i64 %8, 12
  br label %vector.body56

vector.body56:                                    ; preds = %vector.body56, %vector.ph51
  %index57 = phi i64 [ 0, %vector.ph51 ], [ %index.next62, %vector.body56 ]
  %vec.phi58 = phi <2 x i64> [ zeroinitializer, %vector.ph51 ], [ %31, %vector.body56 ]
  %vec.phi59 = phi <2 x i64> [ zeroinitializer, %vector.ph51 ], [ %32, %vector.body56 ]
  %28 = shl i64 %index57, 3
  %29 = getelementptr i8, ptr @_QFEx, i64 %28
  %wide.load60 = load <2 x i64>, ptr %29, align 16, !tbaa !3
  %30 = getelementptr i64, ptr %29, i64 2
  %wide.load61 = load <2 x i64>, ptr %30, align 16, !tbaa !3
  %31 = add <2 x i64> %wide.load60, %vec.phi58
  %32 = add <2 x i64> %wide.load61, %vec.phi59
  %index.next62 = add nuw i64 %index57, 4
  %33 = icmp eq i64 %index.next62, %n.vec53
  br i1 %33, label %middle.block48, label %vector.body56, !llvm.loop !11

middle.block48:                                   ; preds = %vector.body56
  %bin.rdx63 = add <2 x i64> %32, %31
  %34 = call i64 @llvm.vector.reduce.add.v2i64(<2 x i64> %bin.rdx63)
  %cmp.n55 = icmp eq i64 %8, %n.vec53
  br i1 %cmp.n55, label %_FortranASumInteger8x1_contract_simplified.exit30, label %.lr.ph.i27.preheader65

.lr.ph.i27.preheader65:                           ; preds = %.lr.ph.i27.preheader, %middle.block48
  %.ph = phi i64 [ 0, %.lr.ph.i27.preheader ], [ %34, %middle.block48 ]
  %.ph66 = phi i64 [ 0, %.lr.ph.i27.preheader ], [ %n.vec53, %middle.block48 ]
  br label %.lr.ph.i27

.lr.ph.i27:                                       ; preds = %.lr.ph.i27.preheader65, %.lr.ph.i27
  %35 = phi i64 [ %40, %.lr.ph.i27 ], [ %.ph, %.lr.ph.i27.preheader65 ]
  %36 = phi i64 [ %41, %.lr.ph.i27 ], [ %.ph66, %.lr.ph.i27.preheader65 ]
  %37 = shl i64 %36, 3
  %38 = getelementptr i8, ptr @_QFEx, i64 %37
  %39 = load i64, ptr %38, align 8, !tbaa !3
  %40 = add i64 %39, %35
  %41 = add nuw nsw i64 %36, 1
  %exitcond.not.i28 = icmp eq i64 %41, %8
  br i1 %exitcond.not.i28, label %_FortranASumInteger8x1_contract_simplified.exit30, label %.lr.ph.i27, !llvm.loop !12

_FortranASumInteger8x1_contract_simplified.exit30: ; preds = %.lr.ph.i27, %middle.block48, %7
  %42 = phi i64 [ %10, %7 ], [ %27, %middle.block48 ], [ %27, %.lr.ph.i27 ]
  %.lcssa.i29 = phi i64 [ 0, %7 ], [ %34, %middle.block48 ], [ %40, %.lr.ph.i27 ]
  %43 = add i64 %.lcssa.i29, %42
  br label %47

44:                                               ; preds = %.preheader.preheader
  %45 = mul i64 %5, %5
  %46 = mul i64 %45, 60
  br label %47

47:                                               ; preds = %_FortranASumInteger8x1_contract_simplified.exit30, %44
  %.0 = phi i64 [ %43, %_FortranASumInteger8x1_contract_simplified.exit30 ], [ %46, %44 ]
  %48 = call ptr @_FortranAioBeginExternalListOutput(i32 6, ptr nonnull @_QQcl.fd7a9ffcea622bf11173b91cf070a8ed, i32 14)
  %49 = call i1 @_FortranAioOutputInteger64(ptr %48, i64 %.0)
  %50 = call i32 @_FortranAioEndIoStatement(ptr %48)
  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 @_FortranAioBeginExternalListOutput(i32, ptr, i32) local_unnamed_addr

declare i1 @_FortranAioOutputInteger64(ptr, i64) local_unnamed_addr

; 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) #0

; Function Attrs: nocallback nofree nosync nounwind willreturn memory(none)
declare i64 @llvm.vector.reduce.add.v2i64(<2 x i64>) #1

attributes #0 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 = distinct !{!7, !8, !9}
!8 = !{!"llvm.loop.isvectorized", i32 1}
!9 = !{!"llvm.loop.unroll.runtime.disable"}
!10 = distinct !{!10, !9, !8}
!11 = distinct !{!11, !8, !9}
!12 = distinct !{!12, !9, !8}
