program tripledots
implicit none
integer k
character(len=100) s
read *, k
read *, s
if(len_trim(s)<=k) then
  print *, s(1:len_trim(s))
else
  print *, s(1:k) // "..."
end if
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"

@_QFEs = internal global [100 x i8] undef
@_QQcl.71767a56ff20855db98bb8cbbfb1b561 = linkonce constant [73 x i8] c"/home/ubuntu/Downloads/TheStack_IR/Collated/Fortran/Source_1361/source.f\00"
@_QQcl.2E2E2E = linkonce local_unnamed_addr constant [3 x i8] c"..."
@_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.71767a56ff20855db98bb8cbbfb1b561, i32 5)
  %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.71767a56ff20855db98bb8cbbfb1b561, i32 6)
  %6 = call i1 @_FortranAioInputAscii(ptr %5, ptr nonnull @_QFEs, i64 100)
  %7 = call i32 @_FortranAioEndIoStatement(ptr %5)
  br label %8

8:                                                ; preds = %0, %8
  %9 = phi i64 [ 99, %0 ], [ %13, %8 ]
  %10 = getelementptr [100 x [1 x i8]], ptr @_QFEs, i64 0, i64 %9
  %11 = load i8, ptr %10, align 1, !tbaa !3
  %12 = icmp eq i8 %11, 32
  %13 = add nsw i64 %9, -1
  %14 = icmp ne i64 %9, 0
  %15 = and i1 %12, %14
  br i1 %15, label %8, label %16

16:                                               ; preds = %8
  %17 = trunc i64 %9 to i32
  %18 = add i32 %17, 1
  %19 = select i1 %12, i32 0, i32 %18
  %20 = load i32, ptr %1, align 4, !tbaa !3
  %.not = icmp sgt i32 %19, %20
  br i1 %.not, label %37, label %21

21:                                               ; preds = %16
  %22 = call ptr @_FortranAioBeginExternalListOutput(i32 -1, ptr nonnull @_QQcl.71767a56ff20855db98bb8cbbfb1b561, i32 8)
  br label %23

23:                                               ; preds = %21, %23
  %24 = phi i64 [ 99, %21 ], [ %28, %23 ]
  %25 = getelementptr [100 x [1 x i8]], ptr @_QFEs, i64 0, i64 %24
  %26 = load i8, ptr %25, align 1, !tbaa !3
  %27 = icmp eq i8 %26, 32
  %28 = add nsw i64 %24, -1
  %29 = icmp ne i64 %24, 0
  %30 = and i1 %27, %29
  br i1 %30, label %23, label %31

31:                                               ; preds = %23
  %32 = shl i64 %24, 32
  %sext = add i64 %32, 4294967296
  %33 = ashr exact i64 %sext, 32
  %34 = call i64 @llvm.smax.i64(i64 %33, i64 0)
  %35 = select i1 %27, i64 0, i64 %34
  %36 = call i1 @_FortranAioOutputAscii(ptr %22, ptr nonnull @_QFEs, i64 %35)
  br label %45

37:                                               ; preds = %16
  %38 = call ptr @_FortranAioBeginExternalListOutput(i32 -1, ptr nonnull @_QQcl.71767a56ff20855db98bb8cbbfb1b561, i32 10)
  %39 = load i32, ptr %1, align 4, !tbaa !3
  %40 = call i32 @llvm.smax.i32(i32 %39, i32 0)
  %41 = zext i32 %40 to i64
  %42 = add nuw nsw i64 %41, 3
  %43 = alloca i8, i64 %42, align 1
  call void @llvm.memcpy.p0.p0.i64(ptr nonnull align 1 %43, ptr nonnull align 16 @_QFEs, i64 %41, i1 false)
  %uglygep = getelementptr i8, ptr %43, i64 %41
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 1 dereferenceable(3) %uglygep, ptr noundef nonnull align 1 dereferenceable(3) @_QQcl.2E2E2E, i64 3, i1 false), !tbaa !3
  %44 = call i1 @_FortranAioOutputAscii(ptr %38, ptr nonnull %43, i64 %42)
  br label %45

45:                                               ; preds = %31, %37
  %.sink = phi ptr [ %22, %31 ], [ %38, %37 ]
  %46 = call i32 @_FortranAioEndIoStatement(ptr %.sink)
  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 @_FortranAioInputAscii(ptr, ptr, i64) local_unnamed_addr

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

declare i1 @_FortranAioOutputAscii(ptr, ptr, i64) local_unnamed_addr

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

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

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #1

attributes #0 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #1 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }

!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"}
