program abc068b
  implicit none
  integer i, n
  integer :: a(100) = [(trailz(i), i=1,100)]

  read *, n
  print '(i0)', 2**maxval(a(:n))
end program abc068b

; 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 unnamed_addr constant [100 x i32] [i32 0, i32 1, i32 0, i32 2, i32 0, i32 1, i32 0, i32 3, i32 0, i32 1, i32 0, i32 2, i32 0, i32 1, i32 0, i32 4, i32 0, i32 1, i32 0, i32 2, i32 0, i32 1, i32 0, i32 3, i32 0, i32 1, i32 0, i32 2, i32 0, i32 1, i32 0, i32 5, i32 0, i32 1, i32 0, i32 2, i32 0, i32 1, i32 0, i32 3, i32 0, i32 1, i32 0, i32 2, i32 0, i32 1, i32 0, i32 4, i32 0, i32 1, i32 0, i32 2, i32 0, i32 1, i32 0, i32 3, i32 0, i32 1, i32 0, i32 2, i32 0, i32 1, i32 0, i32 6, i32 0, i32 1, i32 0, i32 2, i32 0, i32 1, i32 0, i32 3, i32 0, i32 1, i32 0, i32 2, i32 0, i32 1, i32 0, i32 4, i32 0, i32 1, i32 0, i32 2, i32 0, i32 1, i32 0, i32 3, i32 0, i32 1, i32 0, i32 2, i32 0, i32 1, i32 0, i32 5, i32 0, i32 1, i32 0, i32 2]
@_QQcl.6962c9058a969178061434d4e3b5eb96 = linkonce constant [73 x i8] c"/home/ubuntu/Downloads/TheStack_IR/Collated/Fortran/Source_7084/source.f\00"
@_QQcl.28693029 = linkonce constant [4 x i8] c"(i0)"
@_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.6962c9058a969178061434d4e3b5eb96, i32 6)
  %3 = call i1 @_FortranAioInputInteger(ptr %2, ptr nonnull %1, i32 4)
  %4 = call i32 @_FortranAioEndIoStatement(ptr %2)
  %5 = call ptr @_FortranAioBeginExternalFormattedOutput(ptr nonnull @_QQcl.28693029, i64 4, ptr null, i32 -1, ptr nonnull @_QQcl.6962c9058a969178061434d4e3b5eb96, i32 7)
  %6 = load i32, ptr %1, align 4, !tbaa !3
  %7 = call i32 @llvm.smax.i32(i32 %6, i32 0)
  %8 = zext i32 %7 to i64
  %.not = icmp slt i32 %6, 1
  br i1 %.not, label %__mlir_math_ipowi_i32.exit, label %.lr.ph.i.preheader

.lr.ph.i.preheader:                               ; preds = %0
  %min.iters.check = icmp ult i32 %7, 8
  br i1 %min.iters.check, label %.lr.ph.i.preheader7, label %vector.ph

vector.ph:                                        ; preds = %.lr.ph.i.preheader
  %n.vec = and i64 %8, 2147483640
  br label %vector.body

vector.body:                                      ; preds = %vector.body, %vector.ph
  %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
  %vec.phi = phi <4 x i32> [ <i32 -2147483648, i32 -2147483648, i32 -2147483648, i32 -2147483648>, %vector.ph ], [ %12, %vector.body ]
  %vec.phi5 = phi <4 x i32> [ <i32 -2147483648, i32 -2147483648, i32 -2147483648, i32 -2147483648>, %vector.ph ], [ %13, %vector.body ]
  %9 = shl i64 %index, 2
  %10 = getelementptr i8, ptr @_QFEa, i64 %9
  %wide.load = load <4 x i32>, ptr %10, align 16, !tbaa !3
  %11 = getelementptr i32, ptr %10, i64 4
  %wide.load6 = load <4 x i32>, ptr %11, align 16, !tbaa !3
  %12 = call <4 x i32> @llvm.smax.v4i32(<4 x i32> %wide.load, <4 x i32> %vec.phi)
  %13 = call <4 x i32> @llvm.smax.v4i32(<4 x i32> %wide.load6, <4 x i32> %vec.phi5)
  %index.next = add nuw i64 %index, 8
  %14 = icmp eq i64 %index.next, %n.vec
  br i1 %14, label %middle.block, label %vector.body, !llvm.loop !7

middle.block:                                     ; preds = %vector.body
  %rdx.minmax.select = call <4 x i32> @llvm.smax.v4i32(<4 x i32> %12, <4 x i32> %13)
  %15 = call i32 @llvm.vector.reduce.smax.v4i32(<4 x i32> %rdx.minmax.select)
  %cmp.n = icmp eq i64 %n.vec, %8
  br i1 %cmp.n, label %_FortranAMaxvalInteger4x1_contract_simplified.exit, label %.lr.ph.i.preheader7

.lr.ph.i.preheader7:                              ; preds = %.lr.ph.i.preheader, %middle.block
  %.ph = phi i32 [ -2147483648, %.lr.ph.i.preheader ], [ %15, %middle.block ]
  %.ph8 = phi i64 [ 0, %.lr.ph.i.preheader ], [ %n.vec, %middle.block ]
  br label %.lr.ph.i

.lr.ph.i:                                         ; preds = %.lr.ph.i.preheader7, %.lr.ph.i
  %16 = phi i32 [ %21, %.lr.ph.i ], [ %.ph, %.lr.ph.i.preheader7 ]
  %17 = phi i64 [ %22, %.lr.ph.i ], [ %.ph8, %.lr.ph.i.preheader7 ]
  %18 = shl i64 %17, 2
  %19 = getelementptr i8, ptr @_QFEa, i64 %18
  %20 = load i32, ptr %19, align 4, !tbaa !3
  %21 = call i32 @llvm.smax.i32(i32 %20, i32 %16)
  %22 = add nuw nsw i64 %17, 1
  %exitcond.not.i = icmp eq i64 %22, %8
  br i1 %exitcond.not.i, label %_FortranAMaxvalInteger4x1_contract_simplified.exit, label %.lr.ph.i, !llvm.loop !10

_FortranAMaxvalInteger4x1_contract_simplified.exit: ; preds = %.lr.ph.i, %middle.block
  %.lcssa = phi i32 [ %15, %middle.block ], [ %21, %.lr.ph.i ]
  %23 = icmp eq i32 %.lcssa, 0
  br i1 %23, label %__mlir_math_ipowi_i32.exit, label %24

24:                                               ; preds = %_FortranAMaxvalInteger4x1_contract_simplified.exit
  %25 = icmp slt i32 %.lcssa, 1
  br i1 %25, label %__mlir_math_ipowi_i32.exit, label %.preheader.i

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

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

__mlir_math_ipowi_i32.exit:                       ; preds = %.lr.ph.i1, %0, %24, %_FortranAMaxvalInteger4x1_contract_simplified.exit, %.preheader.i
  %common.ret.op.i = phi i32 [ 1, %_FortranAMaxvalInteger4x1_contract_simplified.exit ], [ %27, %.preheader.i ], [ 0, %24 ], [ 0, %0 ], [ %spec.select.i, %.lr.ph.i1 ]
  %36 = call i1 @_FortranAioOutputInteger32(ptr %5, i32 %common.ret.op.i)
  %37 = call i32 @_FortranAioEndIoStatement(ptr %5)
  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 @_FortranAioBeginExternalFormattedOutput(ptr, i64, ptr, i32, ptr, i32) local_unnamed_addr

declare i1 @_FortranAioOutputInteger32(ptr, i32) local_unnamed_addr

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

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare <4 x i32> @llvm.smax.v4i32(<4 x i32>, <4 x i32>) #1

; Function Attrs: nocallback nofree nosync nounwind willreturn memory(none)
declare i32 @llvm.vector.reduce.smax.v4i32(<4 x i32>) #2

attributes #0 = { mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #1 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #2 = { nocallback nofree nosync nounwind 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, !9}
!8 = !{!"llvm.loop.isvectorized", i32 1}
!9 = !{!"llvm.loop.unroll.runtime.disable"}
!10 = distinct !{!10, !9, !8}
