program main
    integer :: n, mem, ans = 0
    integer :: a(200)
    logical :: flag = .true.

    read *, n
    read *, (a(i), i=1,n)

    do while(flag)
        do i = 1,n
            mem = mod(a(i),2)
            if(mem == 1) then
                flag = .false.
            end if
            a(i) = a(i) / 2
        end do
        if(flag) then
            ans = ans + 1
        end if
    end do
    print *, ans
end program main
; 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 [200 x i32] undef
@_QFEans = internal unnamed_addr global i32 0
@_QFEflag = internal unnamed_addr global i1 false
@_QQcl.f5b6d742fcd8212ba2e9c4f55c469233 = linkonce constant [73 x i8] c"/home/ubuntu/Downloads/TheStack_IR/Collated/Fortran/Source_6615/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.f5b6d742fcd8212ba2e9c4f55c469233, i32 6)
  %3 = call i1 @_FortranAioInputInteger(ptr %2, ptr nonnull %1, i32 4)
  %4 = call i32 @_FortranAioEndIoStatement(ptr %2)
  %5 = call ptr @_FortranAioBeginExternalListInput(i32 -1, ptr nonnull @_QQcl.f5b6d742fcd8212ba2e9c4f55c469233, i32 7)
  %6 = load i32, ptr %1, align 4, !tbaa !3
  %7 = icmp sgt i32 %6, 0
  br i1 %7, label %.lr.ph.preheader, label %._crit_edge

.lr.ph.preheader:                                 ; preds = %0
  %8 = zext i32 %6 to i64
  br label %.lr.ph

.lr.ph:                                           ; preds = %.lr.ph.preheader, %.lr.ph
  %9 = phi i64 [ %14, %.lr.ph ], [ 1, %.lr.ph.preheader ]
  %sext = shl i64 %9, 32
  %10 = ashr exact i64 %sext, 32
  %11 = add nsw i64 %10, -1
  %12 = getelementptr [200 x i32], ptr @_QFEa, i64 0, i64 %11
  %13 = call i1 @_FortranAioInputInteger(ptr %5, ptr %12, i32 4)
  %14 = add nuw nsw i64 %9, 1
  %exitcond.not = icmp eq i64 %9, %8
  br i1 %exitcond.not, label %._crit_edge, label %.lr.ph

._crit_edge:                                      ; preds = %.lr.ph, %0
  %15 = call i32 @_FortranAioEndIoStatement(ptr %5)
  %.b6.pr = load i1, ptr @_QFEflag, align 1
  br i1 %.b6.pr, label %.critedge8, label %.preheader

.preheader:                                       ; preds = %._crit_edge
  %16 = load i32, ptr %1, align 4, !tbaa !3
  %17 = icmp sgt i32 %16, 0
  br i1 %17, label %.lr.ph10.us.preheader, label %.critedge

.lr.ph10.us.preheader:                            ; preds = %.preheader
  %_QFEans.promoted = load i32, ptr @_QFEans, align 4, !tbaa !3
  %18 = zext i32 %16 to i64
  br label %.lr.ph10.us

.lr.ph10.us:                                      ; preds = %.lr.ph10.us.preheader, %.critedge.us
  %19 = phi i32 [ %20, %.critedge.us ], [ %_QFEans.promoted, %.lr.ph10.us.preheader ]
  br label %.outer

.outer:                                           ; preds = %.thread, %.lr.ph10.us
  %indvars.iv.ph = phi i64 [ %indvars.iv.next19, %.thread ], [ 1, %.lr.ph10.us ]
  %.b14.us.ph = phi i1 [ true, %.thread ], [ false, %.lr.ph10.us ]
  br label %21

.critedge.us:                                     ; preds = %._crit_edge11.us
  %20 = add i32 %19, 1
  store i32 %20, ptr @_QFEans, align 4, !tbaa !3
  br label %.lr.ph10.us

21:                                               ; preds = %.outer, %27
  %indvars.iv = phi i64 [ %indvars.iv.next, %27 ], [ %indvars.iv.ph, %.outer ]
  %22 = add nsw i64 %indvars.iv, -1
  %23 = getelementptr [200 x i32], ptr @_QFEa, i64 0, i64 %22
  %24 = load i32, ptr %23, align 4, !tbaa !3
  %25 = and i32 %24, -2147483647
  %26 = icmp eq i32 %25, 1
  br i1 %26, label %.thread, label %27

27:                                               ; preds = %21
  %28 = sdiv i32 %24, 2
  store i32 %28, ptr %23, align 4, !tbaa !3
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %exitcond17.not = icmp eq i64 %indvars.iv, %18
  br i1 %exitcond17.not, label %._crit_edge11.us, label %21

.thread:                                          ; preds = %21
  store i1 true, ptr @_QFEflag, align 1
  %29 = lshr i32 %24, 1
  store i32 %29, ptr %23, align 4, !tbaa !3
  %indvars.iv.next19 = add nuw nsw i64 %indvars.iv, 1
  %exitcond17.not20 = icmp eq i64 %indvars.iv, %18
  br i1 %exitcond17.not20, label %.critedge8, label %.outer

._crit_edge11.us:                                 ; preds = %27
  br i1 %.b14.us.ph, label %.critedge8, label %.critedge.us

.critedge:                                        ; preds = %.preheader, %.critedge
  br label %.critedge

.critedge8:                                       ; preds = %._crit_edge11.us, %.thread, %._crit_edge
  %30 = call ptr @_FortranAioBeginExternalListOutput(i32 -1, ptr nonnull @_QQcl.f5b6d742fcd8212ba2e9c4f55c469233, i32 21)
  %31 = load i32, ptr @_QFEans, align 4, !tbaa !3
  %32 = call i1 @_FortranAioOutputInteger32(ptr %30, i32 %31)
  %33 = 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"}
