PROGRAM ATCODER
implicit none
character(len=10) :: s, ans
character :: a,b
integer :: i,len
  
read(*,*) s

ans = ""
a = "0"
b = "1"

len = len_trim(s)
do i = 1, len
	if (s(i:i) == a) then
    	ans = trim(ans) // a
    else if(s(i:i) == b) then
    	ans = trim(ans) // b
    else if(s(i:i) == "B") then
        ans = ans(1:len_trim(ans)-1)
    end if
end do

write(*,'(a)') trim(ans)

END PROGRAM ATCODER
; 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.bbba8c5f5eee6f3ea857bef2801e35de = linkonce constant [73 x i8] c"/home/ubuntu/Downloads/TheStack_IR/Collated/Fortran/Source_7975/source.f\00"
@_QQcl.30 = linkonce local_unnamed_addr constant [1 x i8] c"0"
@_QQcl.31 = linkonce local_unnamed_addr constant [1 x i8] c"1"
@_QQcl.42 = linkonce constant [1 x i8] c"B"
@_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

define void @_QQmain() local_unnamed_addr {
  %1 = alloca { ptr, i64, i32, i8, i8, i8, i8 }, align 8
  %2 = alloca { ptr, i64, i32, i8, i8, i8, i8 }, align 8
  %3 = alloca { ptr, i64, i32, i8, i8, i8, i8 }, align 8
  %4 = alloca { ptr, i64, i32, i8, i8, i8, i8 }, align 8
  %5 = alloca { ptr, i64, i32, i8, i8, i8, i8 }, align 8
  %6 = alloca { ptr, i64, i32, i8, i8, i8, i8 }, align 8
  %7 = alloca [1 x i8], align 1
  %8 = alloca [10 x i8], align 1
  %9 = alloca [1 x i8], align 1
  %10 = alloca [10 x i8], align 1
  %11 = tail call ptr @_FortranAioBeginExternalListInput(i32 -1, ptr nonnull @_QQcl.bbba8c5f5eee6f3ea857bef2801e35de, i32 7)
  %12 = call i1 @_FortranAioInputAscii(ptr %11, ptr nonnull %10, i64 10)
  %13 = call i32 @_FortranAioEndIoStatement(ptr %11)
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(10) %8, i8 32, i64 10, i1 false), !tbaa !3
  %.unpack = load i8, ptr @_QQcl.30, align 1, !tbaa !3
  store i8 %.unpack, ptr %7, align 1, !tbaa !3
  %.unpack263 = load i8, ptr @_QQcl.31, align 1, !tbaa !3
  store i8 %.unpack263, ptr %9, align 1, !tbaa !3
  br label %14

14:                                               ; preds = %0, %14
  %15 = phi i64 [ 9, %0 ], [ %19, %14 ]
  %16 = getelementptr [10 x [1 x i8]], ptr %10, i64 0, i64 %15
  %17 = load i8, ptr %16, align 1, !tbaa !3
  %18 = icmp eq i8 %17, 32
  %19 = add nsw i64 %15, -1
  %20 = icmp ne i64 %15, 0
  %21 = and i1 %18, %20
  br i1 %21, label %14, label %22

22:                                               ; preds = %14
  %23 = shl i64 %15, 32
  %sext = add i64 %23, 4294967296
  %24 = ashr exact i64 %sext, 32
  %spec.select = select i1 %18, i64 0, i64 %24
  %25 = icmp sgt i64 %spec.select, 0
  br i1 %25, label %.lr.ph273, label %select.unfold._crit_edge

.lr.ph273:                                        ; preds = %22
  %.fca.1.gep146 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8 }, ptr %2, i64 0, i32 1
  %.fca.2.gep148 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8 }, ptr %2, i64 0, i32 2
  %.fca.3.gep150 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8 }, ptr %2, i64 0, i32 3
  %.fca.4.gep152 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8 }, ptr %2, i64 0, i32 4
  %.fca.5.gep154 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8 }, ptr %2, i64 0, i32 5
  %.fca.6.gep156 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8 }, ptr %2, i64 0, i32 6
  %.fca.1.gep29 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8 }, ptr %5, i64 0, i32 1
  %.fca.2.gep31 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8 }, ptr %5, i64 0, i32 2
  %.fca.3.gep33 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8 }, ptr %5, i64 0, i32 3
  %.fca.4.gep35 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8 }, ptr %5, i64 0, i32 4
  %.fca.5.gep37 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8 }, ptr %5, i64 0, i32 5
  %.fca.6.gep39 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8 }, ptr %5, i64 0, i32 6
  %.fca.1.gep202 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8 }, ptr %1, i64 0, i32 1
  %.fca.2.gep204 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8 }, ptr %1, i64 0, i32 2
  %.fca.3.gep206 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8 }, ptr %1, i64 0, i32 3
  %.fca.4.gep208 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8 }, ptr %1, i64 0, i32 4
  %.fca.5.gep210 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8 }, ptr %1, i64 0, i32 5
  %.fca.6.gep212 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8 }, ptr %1, i64 0, i32 6
  %.fca.1.gep = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8 }, ptr %6, i64 0, i32 1
  %.fca.2.gep = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8 }, ptr %6, i64 0, i32 2
  %.fca.3.gep = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8 }, ptr %6, i64 0, i32 3
  %.fca.4.gep = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8 }, ptr %6, i64 0, i32 4
  %.fca.5.gep = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8 }, ptr %6, i64 0, i32 5
  %.fca.6.gep = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8 }, ptr %6, i64 0, i32 6
  br label %26

26:                                               ; preds = %.lr.ph273, %select.unfold
  %indvars.iv = phi i64 [ 1, %.lr.ph273 ], [ %indvars.iv.next, %select.unfold ]
  %27 = add nsw i64 %indvars.iv, -1
  %28 = getelementptr [10 x [1 x i8]], ptr %10, i64 0, i64 %27
  %29 = call i32 @_FortranACharacterCompareScalar1(ptr %28, ptr nonnull %7, i64 1, i64 1)
  %30 = icmp eq i32 %29, 0
  br i1 %30, label %31, label %39

31:                                               ; preds = %26
  store ptr %8, ptr %1, align 8, !tbaa !7
  store i64 10, ptr %.fca.1.gep202, align 8, !tbaa !7
  store i32 20180515, ptr %.fca.2.gep204, align 8, !tbaa !7
  store i8 0, ptr %.fca.3.gep206, align 4, !tbaa !7
  store i8 40, ptr %.fca.4.gep208, align 1, !tbaa !7
  store i8 0, ptr %.fca.5.gep210, align 2, !tbaa !7
  store i8 0, ptr %.fca.6.gep212, align 1, !tbaa !7
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(16) %6, i8 0, i64 16, i1 false)
  store i32 20180515, ptr %.fca.2.gep, align 8, !tbaa !7
  store i8 0, ptr %.fca.3.gep, align 4, !tbaa !7
  store i8 40, ptr %.fca.4.gep, align 1, !tbaa !7
  store i8 2, ptr %.fca.5.gep, align 2, !tbaa !7
  store i8 0, ptr %.fca.6.gep, align 1, !tbaa !7
  %32 = call {} @_FortranATrim(ptr nonnull %6, ptr nonnull %1, ptr nonnull @_QQcl.bbba8c5f5eee6f3ea857bef2801e35de, i32 16)
  %.fca.0.load18 = load ptr, ptr %6, align 8, !tbaa !7
  %.fca.1.load = load i64, ptr %.fca.1.gep, align 8, !tbaa !7
  %33 = add i64 %.fca.1.load, 1
  %34 = alloca i8, i64 %33, align 1
  call void @llvm.memcpy.p0.p0.i64(ptr nonnull align 1 %34, ptr align 1 %.fca.0.load18, i64 %.fca.1.load, i1 false)
  %.fca.0.load13 = load i8, ptr %7, align 1, !tbaa !3
  %35 = getelementptr [1 x i8], ptr %34, i64 %.fca.1.load
  store i8 %.fca.0.load13, ptr %35, align 1, !tbaa !3
  %36 = call i64 @llvm.smin.i64(i64 %33, i64 10)
  call void @llvm.memcpy.p0.p0.i64(ptr nonnull align 1 %8, ptr nonnull align 1 %34, i64 %36, i1 false)
  %37 = sub i64 10, %36
  %38 = icmp sgt i64 %37, 0
  br i1 %38, label %.lr.ph270.preheader, label %._crit_edge271

.lr.ph270.preheader:                              ; preds = %31
  %uglygep278 = getelementptr i8, ptr %8, i64 %36
  call void @llvm.memset.p0.i64(ptr align 1 %uglygep278, i8 32, i64 %37, i1 false), !tbaa !3
  br label %._crit_edge271

._crit_edge271:                                   ; preds = %.lr.ph270.preheader, %31
  call void @free(ptr %.fca.0.load18)
  br label %select.unfold

39:                                               ; preds = %26
  %40 = call i32 @_FortranACharacterCompareScalar1(ptr %28, ptr nonnull %9, i64 1, i64 1)
  %41 = icmp eq i32 %40, 0
  br i1 %41, label %42, label %50

42:                                               ; preds = %39
  store ptr %8, ptr %2, align 8, !tbaa !7
  store i64 10, ptr %.fca.1.gep146, align 8, !tbaa !7
  store i32 20180515, ptr %.fca.2.gep148, align 8, !tbaa !7
  store i8 0, ptr %.fca.3.gep150, align 4, !tbaa !7
  store i8 40, ptr %.fca.4.gep152, align 1, !tbaa !7
  store i8 0, ptr %.fca.5.gep154, align 2, !tbaa !7
  store i8 0, ptr %.fca.6.gep156, align 1, !tbaa !7
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(16) %5, i8 0, i64 16, i1 false)
  store i32 20180515, ptr %.fca.2.gep31, align 8, !tbaa !7
  store i8 0, ptr %.fca.3.gep33, align 4, !tbaa !7
  store i8 40, ptr %.fca.4.gep35, align 1, !tbaa !7
  store i8 2, ptr %.fca.5.gep37, align 2, !tbaa !7
  store i8 0, ptr %.fca.6.gep39, align 1, !tbaa !7
  %43 = call {} @_FortranATrim(ptr nonnull %5, ptr nonnull %2, ptr nonnull @_QQcl.bbba8c5f5eee6f3ea857bef2801e35de, i32 18)
  %.fca.0.load41 = load ptr, ptr %5, align 8, !tbaa !7
  %.fca.1.load44 = load i64, ptr %.fca.1.gep29, align 8, !tbaa !7
  %44 = add i64 %.fca.1.load44, 1
  %45 = alloca i8, i64 %44, align 1
  call void @llvm.memcpy.p0.p0.i64(ptr nonnull align 1 %45, ptr align 1 %.fca.0.load41, i64 %.fca.1.load44, i1 false)
  %.fca.0.load = load i8, ptr %9, align 1, !tbaa !3
  %46 = getelementptr [1 x i8], ptr %45, i64 %.fca.1.load44
  store i8 %.fca.0.load, ptr %46, align 1, !tbaa !3
  %47 = call i64 @llvm.smin.i64(i64 %44, i64 10)
  call void @llvm.memcpy.p0.p0.i64(ptr nonnull align 1 %8, ptr nonnull align 1 %45, i64 %47, i1 false)
  %48 = sub i64 10, %47
  %49 = icmp sgt i64 %48, 0
  br i1 %49, label %.lr.ph268.preheader, label %._crit_edge

.lr.ph268.preheader:                              ; preds = %42
  %uglygep277 = getelementptr i8, ptr %8, i64 %47
  call void @llvm.memset.p0.i64(ptr align 1 %uglygep277, i8 32, i64 %48, i1 false), !tbaa !3
  br label %._crit_edge

._crit_edge:                                      ; preds = %.lr.ph268.preheader, %42
  call void @free(ptr %.fca.0.load41)
  br label %select.unfold

50:                                               ; preds = %39
  %51 = call i32 @_FortranACharacterCompareScalar1(ptr %28, ptr nonnull @_QQcl.42, i64 1, i64 1)
  %52 = icmp eq i32 %51, 0
  br i1 %52, label %.preheader, label %select.unfold

.preheader:                                       ; preds = %50, %.preheader
  %53 = phi i64 [ %57, %.preheader ], [ 9, %50 ]
  %54 = getelementptr [10 x [1 x i8]], ptr %8, i64 0, i64 %53
  %55 = load i8, ptr %54, align 1, !tbaa !3
  %56 = icmp eq i8 %55, 32
  %57 = add nsw i64 %53, -1
  %58 = icmp ne i64 %53, 0
  %59 = and i1 %56, %58
  br i1 %59, label %.preheader, label %60

60:                                               ; preds = %.preheader
  %sext264 = shl i64 %53, 32
  %61 = ashr exact i64 %sext264, 32
  %62 = call i64 @llvm.smax.i64(i64 %61, i64 0)
  %63 = call i64 @llvm.umin.i64(i64 %62, i64 10)
  %64 = select i1 %56, i64 0, i64 %63
  %65 = icmp ult i64 %64, 10
  br i1 %65, label %.lr.ph.preheader, label %select.unfold

.lr.ph.preheader:                                 ; preds = %60
  %66 = sub nuw nsw i64 10, %64
  %uglygep = getelementptr i8, ptr %8, i64 %64
  %smin = call i64 @llvm.smin.i64(i64 %66, i64 1)
  %67 = add nuw nsw i64 %64, %smin
  %68 = sub nuw nsw i64 11, %67
  call void @llvm.memset.p0.i64(ptr align 1 %uglygep, i8 32, i64 %68, i1 false), !tbaa !3
  br label %select.unfold

select.unfold:                                    ; preds = %.lr.ph.preheader, %60, %._crit_edge271, %._crit_edge, %50
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %exitcond.not = icmp eq i64 %indvars.iv, %spec.select
  br i1 %exitcond.not, label %select.unfold._crit_edge, label %26

select.unfold._crit_edge:                         ; preds = %select.unfold, %22
  %69 = call ptr @_FortranAioBeginExternalFormattedOutput(ptr nonnull @_QQcl.286129, i64 3, ptr null, i32 -1, ptr nonnull @_QQcl.bbba8c5f5eee6f3ea857bef2801e35de, i32 24)
  store ptr %8, ptr %3, align 8, !tbaa !7
  %.fca.1.gep99 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8 }, ptr %3, i64 0, i32 1
  store i64 10, ptr %.fca.1.gep99, align 8, !tbaa !7
  %.fca.2.gep101 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8 }, ptr %3, i64 0, i32 2
  store i32 20180515, ptr %.fca.2.gep101, align 8, !tbaa !7
  %.fca.3.gep103 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8 }, ptr %3, i64 0, i32 3
  store i8 0, ptr %.fca.3.gep103, align 4, !tbaa !7
  %.fca.4.gep105 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8 }, ptr %3, i64 0, i32 4
  store i8 40, ptr %.fca.4.gep105, align 1, !tbaa !7
  %.fca.5.gep107 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8 }, ptr %3, i64 0, i32 5
  store i8 0, ptr %.fca.5.gep107, align 2, !tbaa !7
  %.fca.6.gep109 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8 }, ptr %3, i64 0, i32 6
  store i8 0, ptr %.fca.6.gep109, align 1, !tbaa !7
  %.fca.1.gep64 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8 }, ptr %4, i64 0, i32 1
  %.fca.2.gep66 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8 }, ptr %4, i64 0, i32 2
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(16) %4, i8 0, i64 16, i1 false)
  store i32 20180515, ptr %.fca.2.gep66, align 8, !tbaa !7
  %.fca.3.gep68 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8 }, ptr %4, i64 0, i32 3
  store i8 0, ptr %.fca.3.gep68, align 4, !tbaa !7
  %.fca.4.gep70 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8 }, ptr %4, i64 0, i32 4
  store i8 40, ptr %.fca.4.gep70, align 1, !tbaa !7
  %.fca.5.gep72 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8 }, ptr %4, i64 0, i32 5
  store i8 2, ptr %.fca.5.gep72, align 2, !tbaa !7
  %.fca.6.gep74 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8 }, ptr %4, i64 0, i32 6
  store i8 0, ptr %.fca.6.gep74, align 1, !tbaa !7
  %70 = call {} @_FortranATrim(ptr nonnull %4, ptr nonnull %3, ptr nonnull @_QQcl.bbba8c5f5eee6f3ea857bef2801e35de, i32 24)
  %.fca.0.load76 = load ptr, ptr %4, align 8, !tbaa !7
  %.fca.1.load79 = load i64, ptr %.fca.1.gep64, align 8, !tbaa !7
  %71 = call i1 @_FortranAioOutputAscii(ptr %69, ptr %.fca.0.load76, i64 %.fca.1.load79)
  call void @free(ptr %.fca.0.load76)
  %72 = call i32 @_FortranAioEndIoStatement(ptr %69)
  ret void
}

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 i32 @_FortranACharacterCompareScalar1(ptr, ptr, i64, i64) local_unnamed_addr

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

declare ptr @_FortranAioBeginExternalFormattedOutput(ptr, i64, ptr, 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) #1

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

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

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

; 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) #3

attributes #0 = { mustprogress nounwind willreturn allockind("free") memory(argmem: readwrite, inaccessiblemem: readwrite) "alloc-family"="malloc" }
attributes #1 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #2 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #3 = { 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"}
!7 = !{!8, !8, i64 0}
!8 = !{!"descriptor member", !5, i64 0}
