program ABC149C
    implicit none
    real::n
    integer::i,Flag
    read*,n
    do
        Flag = 1
        do i = 2,int(sqrt(n))
            if (mod(int(n),i) == 0) then
                Flag = 0
            end if
        end do
        if (Flag == 1) then
            print*,int(n)
            stop
        else
            n = n + 1
        end if
    end do
end program ABC149C
; 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.273c1f136a73a12f7d4cd936c745d14d = linkonce constant [73 x i8] c"/home/ubuntu/Downloads/TheStack_IR/Collated/Fortran/Source_2732/source.f\00"
@_QQEnvironmentDefaults = local_unnamed_addr constant ptr null

; Function Attrs: noreturn
define void @_QQmain() local_unnamed_addr #0 {
  %1 = alloca float, align 4
  %2 = tail call ptr @_FortranAioBeginExternalListInput(i32 -1, ptr nonnull @_QQcl.273c1f136a73a12f7d4cd936c745d14d, i32 5)
  %3 = call i1 @_FortranAioInputReal32(ptr %2, ptr nonnull %1)
  %4 = call i32 @_FortranAioEndIoStatement(ptr %2)
  %.promoted = load float, ptr %1, align 4, !tbaa !3
  %5 = call contract float @llvm.sqrt.f32(float %.promoted)
  %6 = fptosi float %5 to i32
  %7 = icmp sgt i32 %6, 1
  br i1 %7, label %.lr.ph, label %._crit_edge.thread

.lr.ph:                                           ; preds = %0, %26
  %8 = phi i32 [ %29, %26 ], [ %6, %0 ]
  %9 = phi float [ %27, %26 ], [ %.promoted, %0 ]
  %10 = zext i32 %8 to i64
  %11 = fptosi float %9 to i32
  br label %12

12:                                               ; preds = %.lr.ph, %12
  %.in = phi i64 [ %10, %.lr.ph ], [ %14, %12 ]
  %13 = phi i32 [ 2, %.lr.ph ], [ %17, %12 ]
  %.04 = phi i32 [ 1, %.lr.ph ], [ %spec.select, %12 ]
  %14 = add nsw i64 %.in, -1
  %15 = srem i32 %11, %13
  %16 = icmp eq i32 %15, 0
  %spec.select = select i1 %16, i32 0, i32 %.04
  %17 = add nuw i32 %13, 1
  %18 = icmp ugt i64 %.in, 2
  br i1 %18, label %12, label %._crit_edge

._crit_edge:                                      ; preds = %12
  %19 = icmp eq i32 %spec.select, 1
  br i1 %19, label %._crit_edge.thread, label %26

._crit_edge.thread:                               ; preds = %._crit_edge, %26, %0
  %20 = call ptr @_FortranAioBeginExternalListOutput(i32 -1, ptr nonnull @_QQcl.273c1f136a73a12f7d4cd936c745d14d, i32 14)
  %21 = load float, ptr %1, align 4, !tbaa !3
  %22 = fptosi float %21 to i32
  %23 = call i1 @_FortranAioOutputInteger32(ptr %20, i32 %22)
  %24 = call i32 @_FortranAioEndIoStatement(ptr %20)
  %25 = call {} @_FortranAStopStatement(i32 0, i1 false, i1 false)
  unreachable

26:                                               ; preds = %._crit_edge
  %27 = fadd contract float %9, 1.000000e+00
  store float %27, ptr %1, align 4, !tbaa !3
  %28 = call contract float @llvm.sqrt.f32(float %27)
  %29 = fptosi float %28 to i32
  %30 = icmp sgt i32 %29, 1
  br i1 %30, label %.lr.ph, label %._crit_edge.thread
}

declare ptr @_FortranAioBeginExternalListInput(i32, ptr, i32) local_unnamed_addr

declare i1 @_FortranAioInputReal32(ptr, ptr) 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

declare {} @_FortranAStopStatement(i32, i1, i1) local_unnamed_addr

; Function Attrs: mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare float @llvm.sqrt.f32(float) #1

attributes #0 = { noreturn }
attributes #1 = { mustprogress 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"}
