program an_odd_problem
  implicit none
  integer :: n, a(100) = 0
  read(*,*) n
  read(*,*) a(1:n)
  write(*,'(i0)') sum(mod(a(1:n:2), 2))
end program an_odd_problem
; 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 [100 x i32] zeroinitializer
@_QQcl.111913fc6320d8349ac614612e2aae07 = linkonce constant [72 x i8] c"/home/ubuntu/Downloads/TheStack_IR/Collated/Fortran/Source_934/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

; 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 i32, align 4
  %3 = tail call ptr @_FortranAioBeginExternalListInput(i32 -1, ptr nonnull @_QQcl.111913fc6320d8349ac614612e2aae07, i32 4)
  %4 = call i1 @_FortranAioInputInteger(ptr %3, ptr nonnull %2, i32 4)
  %5 = call i32 @_FortranAioEndIoStatement(ptr %3)
  %6 = call ptr @_FortranAioBeginExternalListInput(i32 -1, ptr nonnull @_QQcl.111913fc6320d8349ac614612e2aae07, i32 5)
  %7 = load i32, ptr %2, align 4, !tbaa !3
  %8 = call i32 @llvm.smax.i32(i32 %7, i32 0)
  %9 = zext i32 %8 to i64
  store ptr @_QFEa, ptr %1, align 8, !tbaa !7
  %.fca.1.gep = 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.gep, align 8, !tbaa !7
  %.fca.2.gep = 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.gep, align 8, !tbaa !7
  %.fca.3.gep = 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.gep, align 4, !tbaa !7
  %.fca.4.gep = 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.gep, align 1, !tbaa !7
  %.fca.5.gep = 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.gep, align 2, !tbaa !7
  %.fca.6.gep = 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.gep, align 1, !tbaa !7
  %.fca.7.0.0.gep = 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.gep, align 8, !tbaa !7
  %.fca.7.0.1.gep = 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 %9, ptr %.fca.7.0.1.gep, align 8, !tbaa !7
  %.fca.7.0.2.gep = 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 4, ptr %.fca.7.0.2.gep, align 8, !tbaa !7
  %10 = call i1 @_FortranAioInputDescriptor(ptr %6, ptr nonnull %1)
  %11 = call i32 @_FortranAioEndIoStatement(ptr %6)
  %12 = call ptr @_FortranAioBeginExternalFormattedOutput(ptr nonnull @_QQcl.28693029, i64 4, ptr null, i32 -1, ptr nonnull @_QQcl.111913fc6320d8349ac614612e2aae07, i32 6)
  %13 = load i32, ptr %2, align 4, !tbaa !3
  %14 = sext i32 %13 to i64
  %15 = add nsw i64 %14, 1
  %16 = sdiv i64 %15, 2
  %17 = call i64 @llvm.smax.i64(i64 %16, i64 0)
  %18 = shl nuw nsw i64 %17, 2
  %19 = call ptr @malloc(i64 %18)
  %.not21 = icmp slt i32 %13, 1
  br i1 %.not21, label %_FortranASumInteger4x1_contract_simplified.exit, label %.lr.ph.preheader

.lr.ph.preheader:                                 ; preds = %0
  %min.iters.check = icmp ult i64 %17, 9
  br i1 %min.iters.check, label %.lr.ph.preheader41, label %vector.ph

vector.ph:                                        ; preds = %.lr.ph.preheader
  %n.mod.vf = and i64 %17, 7
  %20 = icmp eq i64 %n.mod.vf, 0
  %21 = select i1 %20, i64 8, i64 %n.mod.vf
  %n.vec = sub nsw i64 %17, %21
  br label %vector.body

vector.body:                                      ; preds = %vector.body, %vector.ph
  %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
  %22 = shl nuw i64 %index, 1
  %23 = shl i64 %index, 1
  %24 = or i64 %23, 8
  %25 = getelementptr i32, ptr @_QFEa, i64 %22
  %26 = getelementptr i32, ptr @_QFEa, i64 %24
  %wide.vec = load <8 x i32>, ptr %25, align 16, !tbaa !3
  %wide.vec23 = load <8 x i32>, ptr %26, align 16, !tbaa !3
  %strided.vec = shufflevector <8 x i32> %wide.vec, <8 x i32> poison, <4 x i32> <i32 0, i32 2, i32 4, i32 6>
  %strided.vec24 = shufflevector <8 x i32> %wide.vec23, <8 x i32> poison, <4 x i32> <i32 0, i32 2, i32 4, i32 6>
  %27 = srem <4 x i32> %strided.vec, <i32 2, i32 2, i32 2, i32 2>
  %28 = srem <4 x i32> %strided.vec24, <i32 2, i32 2, i32 2, i32 2>
  %29 = getelementptr i32, ptr %19, i64 %index
  store <4 x i32> %27, ptr %29, align 4, !tbaa !3
  %30 = getelementptr i32, ptr %29, i64 4
  store <4 x i32> %28, ptr %30, align 4, !tbaa !3
  %index.next = add nuw i64 %index, 8
  %31 = icmp eq i64 %index.next, %n.vec
  br i1 %31, label %.lr.ph.preheader41, label %vector.body, !llvm.loop !9

.lr.ph.preheader41:                               ; preds = %vector.body, %.lr.ph.preheader
  %.ph42 = phi i64 [ %17, %.lr.ph.preheader ], [ %21, %vector.body ]
  %.ph43 = phi i64 [ 0, %.lr.ph.preheader ], [ %n.vec, %vector.body ]
  br label %.lr.ph

.lr.ph:                                           ; preds = %.lr.ph.preheader41, %.lr.ph
  %32 = phi i64 [ %40, %.lr.ph ], [ %.ph42, %.lr.ph.preheader41 ]
  %33 = phi i64 [ %34, %.lr.ph ], [ %.ph43, %.lr.ph.preheader41 ]
  %34 = add nuw nsw i64 %33, 1
  %35 = shl nuw i64 %33, 1
  %36 = getelementptr i32, ptr @_QFEa, i64 %35
  %37 = load i32, ptr %36, align 8, !tbaa !3
  %38 = srem i32 %37, 2
  %39 = getelementptr i32, ptr %19, i64 %33
  store i32 %38, ptr %39, align 4, !tbaa !3
  %40 = add nsw i64 %32, -1
  %41 = icmp ugt i64 %32, 1
  br i1 %41, label %.lr.ph, label %._crit_edge, !llvm.loop !12

._crit_edge:                                      ; preds = %.lr.ph
  br i1 %.not21, label %_FortranASumInteger4x1_contract_simplified.exit, label %.lr.ph.i.preheader

.lr.ph.i.preheader:                               ; preds = %._crit_edge
  %min.iters.check27 = icmp ult i64 %17, 8
  br i1 %min.iters.check27, label %.lr.ph.i.preheader37, label %vector.ph28

vector.ph28:                                      ; preds = %.lr.ph.i.preheader
  %n.vec30 = and i64 %17, 9223372036854775800
  br label %vector.body32

vector.body32:                                    ; preds = %vector.body32, %vector.ph28
  %index33 = phi i64 [ 0, %vector.ph28 ], [ %index.next36, %vector.body32 ]
  %vec.phi = phi <4 x i32> [ zeroinitializer, %vector.ph28 ], [ %45, %vector.body32 ]
  %vec.phi34 = phi <4 x i32> [ zeroinitializer, %vector.ph28 ], [ %46, %vector.body32 ]
  %42 = shl i64 %index33, 2
  %43 = getelementptr i8, ptr %19, i64 %42
  %wide.load = load <4 x i32>, ptr %43, align 4, !tbaa !3
  %44 = getelementptr i32, ptr %43, i64 4
  %wide.load35 = load <4 x i32>, ptr %44, align 4, !tbaa !3
  %45 = add <4 x i32> %wide.load, %vec.phi
  %46 = add <4 x i32> %wide.load35, %vec.phi34
  %index.next36 = add nuw i64 %index33, 8
  %47 = icmp eq i64 %index.next36, %n.vec30
  br i1 %47, label %middle.block25, label %vector.body32, !llvm.loop !13

middle.block25:                                   ; preds = %vector.body32
  %bin.rdx = add <4 x i32> %46, %45
  %48 = call i32 @llvm.vector.reduce.add.v4i32(<4 x i32> %bin.rdx)
  %cmp.n = icmp eq i64 %17, %n.vec30
  br i1 %cmp.n, label %_FortranASumInteger4x1_contract_simplified.exit, label %.lr.ph.i.preheader37

.lr.ph.i.preheader37:                             ; preds = %.lr.ph.i.preheader, %middle.block25
  %.ph = phi i32 [ 0, %.lr.ph.i.preheader ], [ %48, %middle.block25 ]
  %.ph38 = phi i64 [ 0, %.lr.ph.i.preheader ], [ %n.vec30, %middle.block25 ]
  br label %.lr.ph.i

.lr.ph.i:                                         ; preds = %.lr.ph.i.preheader37, %.lr.ph.i
  %49 = phi i32 [ %54, %.lr.ph.i ], [ %.ph, %.lr.ph.i.preheader37 ]
  %50 = phi i64 [ %55, %.lr.ph.i ], [ %.ph38, %.lr.ph.i.preheader37 ]
  %51 = shl i64 %50, 2
  %52 = getelementptr i8, ptr %19, i64 %51
  %53 = load i32, ptr %52, align 4, !tbaa !3
  %54 = add i32 %53, %49
  %55 = add nuw nsw i64 %50, 1
  %exitcond.not.i = icmp eq i64 %55, %17
  br i1 %exitcond.not.i, label %_FortranASumInteger4x1_contract_simplified.exit, label %.lr.ph.i, !llvm.loop !14

_FortranASumInteger4x1_contract_simplified.exit:  ; preds = %.lr.ph.i, %middle.block25, %0, %._crit_edge
  %.lcssa.i = phi i32 [ 0, %._crit_edge ], [ 0, %0 ], [ %48, %middle.block25 ], [ %54, %.lr.ph.i ]
  %56 = call i1 @_FortranAioOutputInteger32(ptr %12, i32 %.lcssa.i)
  call void @free(ptr %19)
  %57 = call i32 @_FortranAioEndIoStatement(ptr %12)
  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 i1 @_FortranAioInputDescriptor(ptr, 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: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i64 @llvm.smax.i64(i64, i64) #2

; 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

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 = { 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, !11, !10}
!13 = distinct !{!13, !10, !11}
!14 = distinct !{!14, !11, !10}
