      PROGRAM oddsOfOddness
      IMPLICIT NONE
      INTEGER :: N
      
      INTEGER :: i, counterOdd, counterEven
      LOGICAL :: flag
      REAL :: ans
      READ*,N
      
      
      counterOdd = 0
      counterEven = 0
      flag = .true. !odd
      DO i = 1,N
        if(flag)then
          counterOdd = counterOdd + 1
        else
          counterEven = counterEven + 1
        end if
        
        flag = .not.(flag)
      END DO
      
      ans = real(counterOdd)/real(N)
      
      print*,ans
      
      
      
      
      END PROGRAM
      
; 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"

@_QQcl.476e147bfe25e039a1371089fcee9a86 = linkonce constant [73 x i8] c"/home/ubuntu/Downloads/TheStack_IR/Collated/Fortran/Source_3162/source.f\00"
@_QQEnvironmentDefaults = local_unnamed_addr constant ptr null

define void @_QQmain() local_unnamed_addr {
  %1 = alloca i32, align 4
  %2 = tail call ptr @_FortranAioBeginExternalListInput(i32 -1, ptr nonnull @_QQcl.476e147bfe25e039a1371089fcee9a86, i32 8)
  %3 = call i1 @_FortranAioInputInteger(ptr %2, ptr nonnull %1, i32 4)
  %4 = call i32 @_FortranAioEndIoStatement(ptr %2)
  %5 = load i32, ptr %1, align 4, !tbaa !3
  %6 = icmp sgt i32 %5, 0
  br i1 %6, label %.lr.ph.preheader, label %._crit_edge

.lr.ph.preheader:                                 ; preds = %0
  %7 = zext i32 %5 to i64
  %xtraiter = and i64 %7, 3
  %8 = icmp ult i32 %5, 4
  br i1 %8, label %._crit_edge.loopexit.unr-lcssa, label %.lr.ph.preheader.new

.lr.ph.preheader.new:                             ; preds = %.lr.ph.preheader
  %unroll_iter = and i64 %7, 4294967292
  br label %.lr.ph

.lr.ph:                                           ; preds = %.lr.ph, %.lr.ph.preheader.new
  %.0610 = phi i32 [ 0, %.lr.ph.preheader.new ], [ %.1.2, %.lr.ph ]
  %niter = phi i64 [ 0, %.lr.ph.preheader.new ], [ %niter.next.3, %.lr.ph ]
  %.1.2 = add i32 %.0610, 2
  %niter.next.3 = add i64 %niter, 4
  %niter.ncmp.3.not = icmp eq i64 %niter.next.3, %unroll_iter
  br i1 %niter.ncmp.3.not, label %._crit_edge.loopexit.unr-lcssa, label %.lr.ph

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

.lr.ph.epil:                                      ; preds = %._crit_edge.loopexit.unr-lcssa, %.lr.ph.epil
  %.011.epil = phi i32 [ %10, %.lr.ph.epil ], [ 1, %._crit_edge.loopexit.unr-lcssa ]
  %.0610.epil = phi i32 [ %.1.epil, %.lr.ph.epil ], [ %.0610.unr, %._crit_edge.loopexit.unr-lcssa ]
  %epil.iter = phi i64 [ %epil.iter.next, %.lr.ph.epil ], [ 0, %._crit_edge.loopexit.unr-lcssa ]
  %.not.epil = icmp ne i32 %.011.epil, 0
  %9 = zext i1 %.not.epil to i32
  %.1.epil = add i32 %.0610.epil, %9
  %10 = xor i32 %.011.epil, 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.loopexit, label %.lr.ph.epil, !llvm.loop !7

._crit_edge.loopexit:                             ; preds = %.lr.ph.epil, %._crit_edge.loopexit.unr-lcssa
  %.1.lcssa = phi i32 [ %.1.lcssa.ph, %._crit_edge.loopexit.unr-lcssa ], [ %.1.epil, %.lr.ph.epil ]
  %11 = sitofp i32 %.1.lcssa to float
  br label %._crit_edge

._crit_edge:                                      ; preds = %._crit_edge.loopexit, %0
  %.06.lcssa = phi float [ 0.000000e+00, %0 ], [ %11, %._crit_edge.loopexit ]
  %12 = sitofp i32 %5 to float
  %13 = fdiv contract float %.06.lcssa, %12
  %14 = call ptr @_FortranAioBeginExternalListOutput(i32 -1, ptr nonnull @_QQcl.476e147bfe25e039a1371089fcee9a86, i32 26)
  %15 = call i1 @_FortranAioOutputReal32(ptr %14, float %13)
  %16 = call i32 @_FortranAioEndIoStatement(ptr %14)
  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 @_FortranAioOutputReal32(ptr, float) local_unnamed_addr

!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}
!8 = !{!"llvm.loop.unroll.disable"}
