program ABC068B
    implicit none
    integer(8)::N,count_break,i,j
    integer(8)::result=1
    integer(8)::break_max=0
    read(5,*)N

    do i=1,N
        count_break=0
        j=i
        do
            if(mod(j,2)==0)then
                count_break=count_break+1
                j=j/2
            else
                exit
            end if
        end do

        if(count_break>break_max)then
            break_max=count_break
            result=i
        end if
    end do

    print'(i0)',result
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"

@_QFEbreak_max = internal unnamed_addr global i64 0
@_QFEresult = internal unnamed_addr global i64 1
@_QQcl.d0e8477e405ad0275fecc650292227f8 = linkonce constant [73 x i8] c"/home/ubuntu/Downloads/TheStack_IR/Collated/Fortran/Source_7090/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 i64, align 8
  %2 = tail call ptr @_FortranAioBeginExternalListInput(i32 5, ptr nonnull @_QQcl.d0e8477e405ad0275fecc650292227f8, i32 6)
  %3 = call i1 @_FortranAioInputInteger(ptr %2, ptr nonnull %1, i32 8)
  %4 = call i32 @_FortranAioEndIoStatement(ptr %2)
  %5 = load i64, ptr %1, align 8, !tbaa !3
  %6 = icmp sgt i64 %5, 0
  br i1 %6, label %.preheader.preheader, label %._crit_edge20

.preheader.preheader:                             ; preds = %0
  %_QFEbreak_max.promoted = load i64, ptr @_QFEbreak_max, align 8, !tbaa !3
  br label %.preheader

.preheader:                                       ; preds = %.preheader.preheader, %15
  %.01019 = phi i64 [ %16, %15 ], [ 1, %.preheader.preheader ]
  %.011.lcssa1617 = phi i64 [ %.011.lcssa15, %15 ], [ %_QFEbreak_max.promoted, %.preheader.preheader ]
  %7 = and i64 %.01019, 1
  %8 = icmp eq i64 %7, 0
  br i1 %8, label %.lr.ph, label %._crit_edge

.lr.ph:                                           ; preds = %.preheader, %.lr.ph
  %.014 = phi i64 [ %10, %.lr.ph ], [ %.01019, %.preheader ]
  %.01113 = phi i64 [ %9, %.lr.ph ], [ 0, %.preheader ]
  %9 = add i64 %.01113, 1
  %10 = sdiv i64 %.014, 2
  %11 = and i64 %10, 1
  %12 = icmp eq i64 %11, 0
  br i1 %12, label %.lr.ph, label %._crit_edge

._crit_edge:                                      ; preds = %.lr.ph, %.preheader
  %.011.lcssa = phi i64 [ 0, %.preheader ], [ %9, %.lr.ph ]
  %13 = icmp sgt i64 %.011.lcssa, %.011.lcssa1617
  br i1 %13, label %14, label %15

14:                                               ; preds = %._crit_edge
  store i64 %.011.lcssa, ptr @_QFEbreak_max, align 8, !tbaa !3
  store i64 %.01019, ptr @_QFEresult, align 8, !tbaa !3
  br label %15

15:                                               ; preds = %14, %._crit_edge
  %.011.lcssa15 = phi i64 [ %.011.lcssa, %14 ], [ %.011.lcssa1617, %._crit_edge ]
  %16 = add nuw i64 %.01019, 1
  %exitcond.not = icmp eq i64 %.01019, %5
  br i1 %exitcond.not, label %._crit_edge20, label %.preheader

._crit_edge20:                                    ; preds = %15, %0
  %17 = call ptr @_FortranAioBeginExternalFormattedOutput(ptr nonnull @_QQcl.28693029, i64 4, ptr null, i32 -1, ptr nonnull @_QQcl.d0e8477e405ad0275fecc650292227f8, i32 26)
  %18 = load i64, ptr @_QFEresult, align 8, !tbaa !3
  %19 = call i1 @_FortranAioOutputInteger64(ptr %17, i64 %18)
  %20 = call i32 @_FortranAioEndIoStatement(ptr %17)
  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 @_FortranAioOutputInteger64(ptr, i64) 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"}
