IMPLICIT NONE
INTEGER :: I, J, N, K
I = 1
READ*, N
READ*, K
DO J = 1, N
 IF( I > K ) THEN
     I = I + K
 ELSE
     I = I * 2
 END IF
END DO
PRINT*, I
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"

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

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.9341a03f876ff39e07c905329c462698, 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.9341a03f876ff39e07c905329c462698, i32 5)
  %7 = call i1 @_FortranAioInputInteger(ptr %6, ptr nonnull %1, i32 4)
  %8 = call i32 @_FortranAioEndIoStatement(ptr %6)
  %9 = load i32, ptr %2, align 4, !tbaa !3
  %10 = icmp sgt i32 %9, 0
  br i1 %10, label %.lr.ph, label %._crit_edge

.lr.ph:                                           ; preds = %0
  %11 = zext i32 %9 to i64
  %12 = load i32, ptr %1, align 4, !tbaa !3
  %xtraiter = and i64 %11, 3
  %13 = icmp ult i32 %9, 4
  br i1 %13, label %._crit_edge.loopexit.unr-lcssa, label %.lr.ph.new

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

14:                                               ; preds = %14, %.lr.ph.new
  %.07 = phi i32 [ 1, %.lr.ph.new ], [ %.1.3, %14 ]
  %niter = phi i64 [ 0, %.lr.ph.new ], [ %niter.next.3, %14 ]
  %15 = icmp sgt i32 %.07, %12
  %16 = add i32 %12, %.07
  %17 = shl i32 %.07, 1
  %.1 = select i1 %15, i32 %16, i32 %17
  %18 = icmp sgt i32 %.1, %12
  %19 = add i32 %12, %.1
  %20 = shl i32 %.1, 1
  %.1.1 = select i1 %18, i32 %19, i32 %20
  %21 = icmp sgt i32 %.1.1, %12
  %22 = add i32 %12, %.1.1
  %23 = shl i32 %.1.1, 1
  %.1.2 = select i1 %21, i32 %22, i32 %23
  %24 = icmp sgt i32 %.1.2, %12
  %25 = add i32 %12, %.1.2
  %26 = shl i32 %.1.2, 1
  %.1.3 = select i1 %24, i32 %25, i32 %26
  %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 %14

._crit_edge.loopexit.unr-lcssa:                   ; preds = %14, %.lr.ph
  %.1.lcssa.ph = phi i32 [ undef, %.lr.ph ], [ %.1.3, %14 ]
  %.07.unr = phi i32 [ 1, %.lr.ph ], [ %.1.3, %14 ]
  %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
  %.07.epil = phi i32 [ %.1.epil, %.epil.preheader ], [ %.07.unr, %._crit_edge.loopexit.unr-lcssa ]
  %epil.iter = phi i64 [ %epil.iter.next, %.epil.preheader ], [ 0, %._crit_edge.loopexit.unr-lcssa ]
  %27 = icmp sgt i32 %.07.epil, %12
  %28 = add i32 %12, %.07.epil
  %29 = shl i32 %.07.epil, 1
  %.1.epil = select i1 %27, i32 %28, i32 %29
  %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 !7

._crit_edge:                                      ; preds = %._crit_edge.loopexit.unr-lcssa, %.epil.preheader, %0
  %.0.lcssa = phi i32 [ 1, %0 ], [ %.1.lcssa.ph, %._crit_edge.loopexit.unr-lcssa ], [ %.1.epil, %.epil.preheader ]
  %30 = call ptr @_FortranAioBeginExternalListOutput(i32 -1, ptr nonnull @_QQcl.9341a03f876ff39e07c905329c462698, i32 13)
  %31 = call i1 @_FortranAioOutputInteger32(ptr %30, i32 %.0.lcssa)
  %32 = call i32 @_FortranAioEndIoStatement(ptr %30)
  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 @_FortranAioOutputInteger32(ptr, i32) 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"}
