program tenquestionthree
    implicit none
    integer n, i, x
    integer,allocatable,dimension(:) ::A
    x=30
    read(*,*) n
    allocate(A(n))
     read(*,*) A                                !横に読ます時これでいいらしい
     do i=1,n
      do while ((mod(A(i),2**x)).ne.0)          !do while文．論理が真ならループを繰り返す．最も2の成分が少ないA(i)を探してる
      x=x-1
      end do
    end do
    write(*,*) x
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"

@_QFEa.0 = internal unnamed_addr global ptr null
@_QFEa.8 = internal unnamed_addr global i64 0
@_QQcl.128b475697ce00d7c36f7b4a69db94f0 = linkonce constant [73 x i8] c"/home/ubuntu/Downloads/TheStack_IR/Collated/Fortran/Source_6612/source.f\00"
@_QQEnvironmentDefaults = local_unnamed_addr constant ptr null

; Function Attrs: mustprogress nofree nounwind willreturn allockind("alloc,uninitialized") allocsize(0) memory(inaccessiblemem: readwrite)
declare noalias noundef ptr @malloc(i64 noundef) local_unnamed_addr #0

define void @_QQmain() local_unnamed_addr {
  %1 = alloca { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, align 8
  %2 = alloca i32, align 4
  %3 = tail call ptr @_FortranAioBeginExternalListInput(i32 -1, ptr nonnull @_QQcl.128b475697ce00d7c36f7b4a69db94f0, i32 6)
  %4 = call i1 @_FortranAioInputInteger(ptr %3, ptr nonnull %2, i32 4)
  %5 = call i32 @_FortranAioEndIoStatement(ptr %3)
  %6 = load i32, ptr %2, align 4, !tbaa !3
  %7 = call i32 @llvm.smax.i32(i32 %6, i32 0)
  %8 = zext i32 %7 to i64
  %9 = shl nuw nsw i64 %8, 2
  %10 = call ptr @malloc(i64 %9)
  store ptr %10, ptr @_QFEa.0, align 8, !tbaa !7
  store i64 %8, ptr @_QFEa.8, align 8, !tbaa !7
  %11 = call ptr @_FortranAioBeginExternalListInput(i32 -1, ptr nonnull @_QQcl.128b475697ce00d7c36f7b4a69db94f0, i32 8)
  %.unpack = load ptr, ptr @_QFEa.0, align 8, !tbaa !7
  %.unpack91.unpack.unpack93 = load i64, ptr @_QFEa.8, align 8, !tbaa !7
  store ptr %.unpack, ptr %1, align 8, !tbaa !7
  %.fca.1.gep = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, ptr %1, i64 0, i32 1
  store i64 4, ptr %.fca.1.gep, align 8, !tbaa !7
  %.fca.2.gep = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, ptr %1, i64 0, i32 2
  store i32 20180515, ptr %.fca.2.gep, align 8, !tbaa !7
  %.fca.3.gep = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, ptr %1, i64 0, i32 3
  store i8 1, ptr %.fca.3.gep, align 4, !tbaa !7
  %.fca.4.gep = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, ptr %1, i64 0, i32 4
  store i8 9, ptr %.fca.4.gep, align 1, !tbaa !7
  %.fca.5.gep = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, ptr %1, i64 0, i32 5
  store i8 0, ptr %.fca.5.gep, align 2, !tbaa !7
  %.fca.6.gep = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, ptr %1, i64 0, i32 6
  store i8 0, ptr %.fca.6.gep, align 1, !tbaa !7
  %.fca.7.0.0.gep = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, ptr %1, i64 0, i32 7, i64 0, i64 0
  store i64 1, ptr %.fca.7.0.0.gep, align 8, !tbaa !7
  %.fca.7.0.1.gep = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, ptr %1, i64 0, i32 7, i64 0, i64 1
  store i64 %.unpack91.unpack.unpack93, ptr %.fca.7.0.1.gep, align 8, !tbaa !7
  %.fca.7.0.2.gep = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, ptr %1, i64 0, i32 7, i64 0, i64 2
  store i64 4, ptr %.fca.7.0.2.gep, align 8, !tbaa !7
  %12 = call i1 @_FortranAioInputDescriptor(ptr %11, ptr nonnull %1)
  %13 = call i32 @_FortranAioEndIoStatement(ptr %11)
  %14 = load i32, ptr %2, align 4, !tbaa !3
  %15 = icmp sgt i32 %14, 0
  br i1 %15, label %.preheader.lr.ph, label %._crit_edge

.preheader.lr.ph:                                 ; preds = %0
  %.unpack96 = load ptr, ptr @_QFEa.0, align 8, !tbaa !7
  br label %.preheader

.preheader:                                       ; preds = %.preheader.lr.ph, %36
  %.0110 = phi i32 [ 30, %.preheader.lr.ph ], [ %.1, %36 ]
  %.074109 = phi i32 [ 1, %.preheader.lr.ph ], [ %37, %36 ]
  %16 = sext i32 %.074109 to i64
  %17 = add nsw i64 %16, -1
  %18 = getelementptr i32, ptr %.unpack96, i64 %17
  %19 = load i32, ptr %18, align 4, !tbaa !3
  br label %20

20:                                               ; preds = %__mlir_math_ipowi_i32.exit, %.preheader
  %.1 = phi i32 [ %35, %__mlir_math_ipowi_i32.exit ], [ %.0110, %.preheader ]
  %21 = icmp eq i32 %.1, 0
  br i1 %21, label %__mlir_math_ipowi_i32.exit, label %22

22:                                               ; preds = %20
  %23 = icmp slt i32 %.1, 1
  br i1 %23, label %__mlir_math_ipowi_i32.exit, label %.preheader.i

.preheader.i:                                     ; preds = %22
  %24 = and i32 %.1, 1
  %.not3.i = icmp eq i32 %24, 0
  %25 = select i1 %.not3.i, i32 1, i32 2
  %26 = icmp eq i32 %.1, 1
  br i1 %26, label %__mlir_math_ipowi_i32.exit, label %.lr.ph.i

.lr.ph.i:                                         ; preds = %.preheader.i, %.lr.ph.i
  %spec.select4.i = phi i32 [ %spec.select.i, %.lr.ph.i ], [ %25, %.preheader.i ]
  %27 = phi i32 [ %29, %.lr.ph.i ], [ %.1, %.preheader.i ]
  %28 = phi i32 [ %30, %.lr.ph.i ], [ 2, %.preheader.i ]
  %29 = lshr i32 %27, 1
  %30 = mul i32 %28, %28
  %31 = and i32 %27, 2
  %.not.i = icmp eq i32 %31, 0
  %32 = select i1 %.not.i, i32 1, i32 %30
  %spec.select.i = mul i32 %32, %spec.select4.i
  %33 = icmp ult i32 %27, 4
  br i1 %33, label %__mlir_math_ipowi_i32.exit, label %.lr.ph.i

__mlir_math_ipowi_i32.exit:                       ; preds = %.lr.ph.i, %22, %20, %.preheader.i
  %common.ret.op.i = phi i32 [ 1, %20 ], [ %25, %.preheader.i ], [ 0, %22 ], [ %spec.select.i, %.lr.ph.i ]
  %34 = srem i32 %19, %common.ret.op.i
  %.not = icmp eq i32 %34, 0
  %35 = add i32 %.1, -1
  br i1 %.not, label %36, label %20

36:                                               ; preds = %__mlir_math_ipowi_i32.exit
  %37 = add nuw i32 %.074109, 1
  %exitcond.not = icmp eq i32 %.074109, %14
  br i1 %exitcond.not, label %._crit_edge, label %.preheader

._crit_edge:                                      ; preds = %36, %0
  %.0.lcssa = phi i32 [ 30, %0 ], [ %.1, %36 ]
  %38 = call ptr @_FortranAioBeginExternalListOutput(i32 -1, ptr nonnull @_QQcl.128b475697ce00d7c36f7b4a69db94f0, i32 14)
  %39 = call i1 @_FortranAioOutputInteger32(ptr %38, i32 %.0.lcssa)
  %40 = call i32 @_FortranAioEndIoStatement(ptr %38)
  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 i1 @_FortranAioInputDescriptor(ptr, 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.smax.i32(i32, i32) #1

attributes #0 = { mustprogress nofree nounwind willreturn allockind("alloc,uninitialized") allocsize(0) memory(inaccessiblemem: readwrite) "alloc-family"="malloc" }
attributes #1 = { 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 = !{!8, !8, i64 0}
!8 = !{!"descriptor member", !5, i64 0}
