program ABC_076_B_AdditionandMultiplication
   implicit none
   integer N, K, countN, i
   read(*, *) N, K
   countN = 1
   do i = 1, N
       if(countN * 2 <= countN + K) then
	       countN = countN * 2
	   else
	       countN = countN + K
	   end if
   end do
   write(*, *) countN
end program ABC_076_B_AdditionandMultiplication
; 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.471ec9ef449ff4d108ee7cbf714c616a = linkonce constant [73 x i8] c"/home/ubuntu/Downloads/TheStack_IR/Collated/Fortran/Source_6785/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.471ec9ef449ff4d108ee7cbf714c616a, i32 4)
  %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 %2, align 4, !tbaa !3
  %8 = icmp sgt i32 %7, 0
  br i1 %8, label %.lr.ph, label %._crit_edge

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

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

12:                                               ; preds = %12, %.lr.ph.new
  %.08 = phi i32 [ 1, %.lr.ph.new ], [ %..3, %12 ]
  %niter = phi i64 [ 0, %.lr.ph.new ], [ %niter.next.3, %12 ]
  %13 = shl i32 %.08, 1
  %14 = add i32 %10, %.08
  %. = call i32 @llvm.smin.i32(i32 %13, i32 %14)
  %15 = shl i32 %., 1
  %16 = add i32 %10, %.
  %..1 = call i32 @llvm.smin.i32(i32 %15, i32 %16)
  %17 = shl i32 %..1, 1
  %18 = add i32 %10, %..1
  %..2 = call i32 @llvm.smin.i32(i32 %17, i32 %18)
  %19 = shl i32 %..2, 1
  %20 = add i32 %10, %..2
  %..3 = call i32 @llvm.smin.i32(i32 %19, i32 %20)
  %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 %12

._crit_edge.loopexit.unr-lcssa:                   ; preds = %12, %.lr.ph
  %..lcssa.ph = phi i32 [ undef, %.lr.ph ], [ %..3, %12 ]
  %.08.unr = phi i32 [ 1, %.lr.ph ], [ %..3, %12 ]
  %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
  %.08.epil = phi i32 [ %..epil, %.epil.preheader ], [ %.08.unr, %._crit_edge.loopexit.unr-lcssa ]
  %epil.iter = phi i64 [ %epil.iter.next, %.epil.preheader ], [ 0, %._crit_edge.loopexit.unr-lcssa ]
  %21 = shl i32 %.08.epil, 1
  %22 = add i32 %10, %.08.epil
  %..epil = call i32 @llvm.smin.i32(i32 %21, i32 %22)
  %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 ], [ %..lcssa.ph, %._crit_edge.loopexit.unr-lcssa ], [ %..epil, %.epil.preheader ]
  %23 = call ptr @_FortranAioBeginExternalListOutput(i32 -1, ptr nonnull @_QQcl.471ec9ef449ff4d108ee7cbf714c616a, i32 13)
  %24 = call i1 @_FortranAioOutputInteger32(ptr %23, i32 %.0.lcssa)
  %25 = call i32 @_FortranAioEndIoStatement(ptr %23)
  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

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

attributes #0 = { nocallback nofree nosync nounwind speculatable 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}
!8 = !{!"llvm.loop.unroll.disable"}
