program prob1
    implicit none
    character(len=3)::S,T
    integer::l
    read(*,*) S
    l = len_trim(S)
    if(l == 2) then
        write(*,'(a)') trim(S)
    else
        T(1:1) = S(3:3)
        T(2:2) = S(2:2)
        T(3:3) = S(1:1)
        write(*,'(a)') trim(T)
    end if
    stop
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"

@_QQcl.65f11a32f7a63b9e93974f401f47b751 = linkonce constant [73 x i8] c"/home/ubuntu/Downloads/TheStack_IR/Collated/Fortran/Source_5409/source.f\00"
@_QQcl.286129 = linkonce constant [3 x i8] c"(a)"
@_QQEnvironmentDefaults = local_unnamed_addr constant ptr null

; Function Attrs: mustprogress nounwind willreturn allockind("free") memory(argmem: readwrite, inaccessiblemem: readwrite)
declare void @free(ptr allocptr nocapture noundef) local_unnamed_addr #0

; Function Attrs: noreturn
define void @_QQmain() local_unnamed_addr #1 {
  %1 = alloca { ptr, i64, i32, i8, i8, i8, i8 }, align 8
  %.sroa.gep206 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8 }, ptr %1, i64 0, i32 6
  %.sroa.gep203 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8 }, ptr %1, i64 0, i32 5
  %.sroa.gep200 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8 }, ptr %1, i64 0, i32 4
  %.sroa.gep197 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8 }, ptr %1, i64 0, i32 3
  %.sroa.gep194 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8 }, ptr %1, i64 0, i32 2
  %.sroa.gep191 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8 }, ptr %1, i64 0, i32 1
  %2 = alloca { ptr, i64, i32, i8, i8, i8, i8 }, align 8
  %.sroa.gep207 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8 }, ptr %2, i64 0, i32 6
  %.sroa.gep204 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8 }, ptr %2, i64 0, i32 5
  %.sroa.gep201 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8 }, ptr %2, i64 0, i32 4
  %.sroa.gep198 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8 }, ptr %2, i64 0, i32 3
  %.sroa.gep195 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8 }, ptr %2, i64 0, i32 2
  %.sroa.gep192 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8 }, ptr %2, i64 0, i32 1
  %3 = alloca { ptr, i64, i32, i8, i8, i8, i8 }, align 8
  %.sroa.gep190 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8 }, ptr %3, i64 0, i32 6
  %.sroa.gep187 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8 }, ptr %3, i64 0, i32 5
  %.sroa.gep184 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8 }, ptr %3, i64 0, i32 4
  %.sroa.gep181 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8 }, ptr %3, i64 0, i32 3
  %.sroa.gep178 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8 }, ptr %3, i64 0, i32 2
  %.sroa.gep175 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8 }, ptr %3, i64 0, i32 1
  %4 = alloca { ptr, i64, i32, i8, i8, i8, i8 }, align 8
  %.sroa.gep189 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8 }, ptr %4, i64 0, i32 6
  %.sroa.gep186 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8 }, ptr %4, i64 0, i32 5
  %.sroa.gep183 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8 }, ptr %4, i64 0, i32 4
  %.sroa.gep180 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8 }, ptr %4, i64 0, i32 3
  %.sroa.gep177 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8 }, ptr %4, i64 0, i32 2
  %.sroa.gep = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8 }, ptr %4, i64 0, i32 1
  %5 = alloca [3 x i8], align 1
  %6 = alloca [3 x i8], align 1
  %7 = tail call ptr @_FortranAioBeginExternalListInput(i32 -1, ptr nonnull @_QQcl.65f11a32f7a63b9e93974f401f47b751, i32 5)
  %8 = call i1 @_FortranAioInputAscii(ptr %7, ptr nonnull %5, i64 3)
  %9 = call i32 @_FortranAioEndIoStatement(ptr %7)
  %10 = getelementptr inbounds [3 x [1 x i8]], ptr %5, i64 0, i64 2
  %11 = load i8, ptr %10, align 1, !tbaa !3
  %12 = icmp eq i8 %11, 32
  br i1 %12, label %13, label %20

13:                                               ; preds = %0
  %14 = getelementptr inbounds [3 x [1 x i8]], ptr %5, i64 0, i64 1
  %15 = load i8, ptr %14, align 1, !tbaa !3
  %16 = icmp eq i8 %15, 32
  br i1 %16, label %17, label %20

17:                                               ; preds = %13
  %18 = load i8, ptr %5, align 1, !tbaa !3
  %19 = icmp eq i8 %18, 32
  br label %20

20:                                               ; preds = %17, %13, %0
  %21 = phi i1 [ true, %17 ], [ false, %13 ], [ true, %0 ]
  %.lcssa = phi i1 [ %19, %17 ], [ %16, %13 ], [ %12, %0 ]
  %.not152 = or i1 %.lcssa, %21
  br i1 %.not152, label %24, label %22

22:                                               ; preds = %20
  %23 = call ptr @_FortranAioBeginExternalFormattedOutput(ptr nonnull @_QQcl.286129, i64 3, ptr null, i32 -1, ptr nonnull @_QQcl.65f11a32f7a63b9e93974f401f47b751, i32 8)
  store ptr %5, ptr %1, align 8, !tbaa !7
  br label %33

24:                                               ; preds = %20
  %25 = getelementptr inbounds [3 x [1 x i8]], ptr %5, i64 0, i64 2
  %26 = load i8, ptr %25, align 1
  store i8 %26, ptr %6, align 1
  %27 = getelementptr inbounds [3 x [1 x i8]], ptr %5, i64 0, i64 1
  %28 = getelementptr inbounds [3 x [1 x i8]], ptr %6, i64 0, i64 1
  %29 = load i8, ptr %27, align 1
  store i8 %29, ptr %28, align 1
  %30 = getelementptr inbounds [3 x [1 x i8]], ptr %6, i64 0, i64 2
  %31 = load i8, ptr %5, align 1
  store i8 %31, ptr %30, align 1
  %32 = call ptr @_FortranAioBeginExternalFormattedOutput(ptr nonnull @_QQcl.286129, i64 3, ptr null, i32 -1, ptr nonnull @_QQcl.65f11a32f7a63b9e93974f401f47b751, i32 13)
  store ptr %6, ptr %2, align 8, !tbaa !7
  br label %33

33:                                               ; preds = %22, %24
  %.sink173 = phi ptr [ %1, %22 ], [ %2, %24 ]
  %.sink167 = phi ptr [ %4, %22 ], [ %3, %24 ]
  %.sink160 = phi i32 [ 8, %22 ], [ 13, %24 ]
  %.sink156 = phi ptr [ %23, %22 ], [ %32, %24 ]
  %.sink167.sroa.phi = phi ptr [ %.sroa.gep, %22 ], [ %.sroa.gep175, %24 ]
  %.sink167.sroa.phi176 = phi ptr [ %.sroa.gep177, %22 ], [ %.sroa.gep178, %24 ]
  %.sink167.sroa.phi179 = phi ptr [ %.sroa.gep180, %22 ], [ %.sroa.gep181, %24 ]
  %.sink167.sroa.phi182 = phi ptr [ %.sroa.gep183, %22 ], [ %.sroa.gep184, %24 ]
  %.sink167.sroa.phi185 = phi ptr [ %.sroa.gep186, %22 ], [ %.sroa.gep187, %24 ]
  %.sink167.sroa.phi188 = phi ptr [ %.sroa.gep189, %22 ], [ %.sroa.gep190, %24 ]
  %.sink173.sroa.phi = phi ptr [ %.sroa.gep191, %22 ], [ %.sroa.gep192, %24 ]
  %.sink173.sroa.phi193 = phi ptr [ %.sroa.gep194, %22 ], [ %.sroa.gep195, %24 ]
  %.sink173.sroa.phi196 = phi ptr [ %.sroa.gep197, %22 ], [ %.sroa.gep198, %24 ]
  %.sink173.sroa.phi199 = phi ptr [ %.sroa.gep200, %22 ], [ %.sroa.gep201, %24 ]
  %.sink173.sroa.phi202 = phi ptr [ %.sroa.gep203, %22 ], [ %.sroa.gep204, %24 ]
  %.sink173.sroa.phi205 = phi ptr [ %.sroa.gep206, %22 ], [ %.sroa.gep207, %24 ]
  store i64 3, ptr %.sink173.sroa.phi, align 8, !tbaa !7
  store i32 20180515, ptr %.sink173.sroa.phi193, align 8, !tbaa !7
  store i8 0, ptr %.sink173.sroa.phi196, align 4, !tbaa !7
  store i8 40, ptr %.sink173.sroa.phi199, align 1, !tbaa !7
  store i8 0, ptr %.sink173.sroa.phi202, align 2, !tbaa !7
  store i8 0, ptr %.sink173.sroa.phi205, align 1, !tbaa !7
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(16) %.sink167, i8 0, i64 16, i1 false)
  store i32 20180515, ptr %.sink167.sroa.phi176, align 8, !tbaa !7
  store i8 0, ptr %.sink167.sroa.phi179, align 4, !tbaa !7
  store i8 40, ptr %.sink167.sroa.phi182, align 1, !tbaa !7
  store i8 2, ptr %.sink167.sroa.phi185, align 2, !tbaa !7
  store i8 0, ptr %.sink167.sroa.phi188, align 1, !tbaa !7
  %34 = call {} @_FortranATrim(ptr nonnull %.sink167, ptr nonnull %.sink173, ptr nonnull @_QQcl.65f11a32f7a63b9e93974f401f47b751, i32 %.sink160)
  %.fca.0.load.sink157 = load ptr, ptr %.sink167, align 8, !tbaa !7
  %.fca.1.load = load i64, ptr %.sink167.sroa.phi, align 8, !tbaa !7
  %35 = call i1 @_FortranAioOutputAscii(ptr %.sink156, ptr %.fca.0.load.sink157, i64 %.fca.1.load)
  call void @free(ptr %.fca.0.load.sink157)
  %36 = call i32 @_FortranAioEndIoStatement(ptr %.sink156)
  %37 = call {} @_FortranAStopStatement(i32 0, i1 false, i1 false)
  unreachable
}

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

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

declare i32 @_FortranAioEndIoStatement(ptr) local_unnamed_addr

declare ptr @_FortranAioBeginExternalFormattedOutput(ptr, i64, ptr, i32, ptr, i32) local_unnamed_addr

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

declare {} @_FortranATrim(ptr, ptr, ptr, i32) local_unnamed_addr

declare {} @_FortranAStopStatement(i32, i1, i1) local_unnamed_addr

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #2

attributes #0 = { mustprogress nounwind willreturn allockind("free") memory(argmem: readwrite, inaccessiblemem: readwrite) "alloc-family"="malloc" }
attributes #1 = { noreturn }
attributes #2 = { nocallback nofree nounwind willreturn memory(argmem: write) }

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