program bbb
implicit none

integer :: i, m, res
integer, dimension(5) :: meal, one
integer, dimension(1) :: mloc
read*, meal

res=0

do i=1,5
one(i)=meal(i)-(meal(i)/10)*10
if(one(i)==0) one(i)=10
end do

m=minval(one)
mloc=minloc(one)

do i=1, 5
 if(one(i)==10) then
 res=res+meal(i)
 else
 res=res+(meal(i)/10)*10+10
 end if
end do

res=res-10+one(mloc(1))

write(*,'(i0)') res

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.1b78324675022a492a13f6c70f069756 = linkonce constant [73 x i8] c"/home/ubuntu/Downloads/TheStack_IR/Collated/Fortran/Source_4554/source.f\00"
@_QQcl.28693029 = linkonce constant [4 x i8] c"(i0)"
@_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, [1 x [3 x i64]] }, align 8
  %2 = alloca { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, align 8
  %3 = alloca { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, align 8
  %4 = alloca [5 x i32], align 4
  %5 = alloca [5 x i32], align 4
  %6 = tail call ptr @_FortranAioBeginExternalListInput(i32 -1, ptr nonnull @_QQcl.1b78324675022a492a13f6c70f069756, i32 7)
  store ptr %4, ptr %2, align 8, !tbaa !3
  %.fca.1.gep25 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, ptr %2, i64 0, i32 1
  store i64 4, ptr %.fca.1.gep25, align 8, !tbaa !3
  %.fca.2.gep27 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, ptr %2, i64 0, i32 2
  store i32 20180515, ptr %.fca.2.gep27, align 8, !tbaa !3
  %.fca.3.gep29 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, ptr %2, i64 0, i32 3
  store i8 1, ptr %.fca.3.gep29, align 4, !tbaa !3
  %.fca.4.gep31 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, ptr %2, i64 0, i32 4
  store i8 9, ptr %.fca.4.gep31, align 1, !tbaa !3
  %.fca.5.gep33 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, ptr %2, i64 0, i32 5
  store i8 0, ptr %.fca.5.gep33, align 2, !tbaa !3
  %.fca.6.gep35 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, ptr %2, i64 0, i32 6
  store i8 0, ptr %.fca.6.gep35, align 1, !tbaa !3
  %.fca.7.0.0.gep37 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, ptr %2, i64 0, i32 7, i64 0, i64 0
  store i64 1, ptr %.fca.7.0.0.gep37, align 8, !tbaa !3
  %.fca.7.0.1.gep39 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, ptr %2, i64 0, i32 7, i64 0, i64 1
  store i64 5, ptr %.fca.7.0.1.gep39, align 8, !tbaa !3
  %.fca.7.0.2.gep41 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, ptr %2, i64 0, i32 7, i64 0, i64 2
  store i64 4, ptr %.fca.7.0.2.gep41, align 8, !tbaa !3
  %7 = call i1 @_FortranAioInputDescriptor(ptr %6, ptr nonnull %2)
  %8 = call i32 @_FortranAioEndIoStatement(ptr %6)
  %9 = load i32, ptr %4, align 4, !tbaa !7
  %.fr112 = freeze i32 %9
  %10 = srem i32 %.fr112, 10
  %11 = icmp eq i32 %10, 0
  %spec.select = select i1 %11, i32 10, i32 %10
  store i32 %spec.select, ptr %5, align 4, !tbaa !7
  %12 = getelementptr inbounds [5 x i32], ptr %4, i64 0, i64 1
  %13 = load i32, ptr %12, align 4, !tbaa !7
  %.fr112.1 = freeze i32 %13
  %14 = srem i32 %.fr112.1, 10
  %15 = getelementptr inbounds [5 x i32], ptr %5, i64 0, i64 1
  %16 = icmp eq i32 %14, 0
  %spec.select.1 = select i1 %16, i32 10, i32 %14
  store i32 %spec.select.1, ptr %15, align 4, !tbaa !7
  %17 = getelementptr inbounds [5 x i32], ptr %4, i64 0, i64 2
  %18 = load i32, ptr %17, align 4, !tbaa !7
  %.fr112.2 = freeze i32 %18
  %19 = srem i32 %.fr112.2, 10
  %20 = getelementptr inbounds [5 x i32], ptr %5, i64 0, i64 2
  %21 = icmp eq i32 %19, 0
  %spec.select.2 = select i1 %21, i32 10, i32 %19
  store i32 %spec.select.2, ptr %20, align 4, !tbaa !7
  %22 = getelementptr inbounds [5 x i32], ptr %4, i64 0, i64 3
  %23 = load i32, ptr %22, align 4, !tbaa !7
  %.fr112.3 = freeze i32 %23
  %24 = srem i32 %.fr112.3, 10
  %25 = getelementptr inbounds [5 x i32], ptr %5, i64 0, i64 3
  %26 = icmp eq i32 %24, 0
  %spec.select.3 = select i1 %26, i32 10, i32 %24
  store i32 %spec.select.3, ptr %25, align 4, !tbaa !7
  %27 = getelementptr inbounds [5 x i32], ptr %4, i64 0, i64 4
  %28 = load i32, ptr %27, align 4, !tbaa !7
  %.fr112.4 = freeze i32 %28
  %29 = srem i32 %.fr112.4, 10
  %30 = getelementptr inbounds [5 x i32], ptr %5, i64 0, i64 4
  %31 = icmp eq i32 %29, 0
  %spec.select.4 = select i1 %31, i32 10, i32 %29
  store i32 %spec.select.4, ptr %30, align 4, !tbaa !7
  store ptr %5, ptr %1, align 8, !tbaa !3
  %.fca.1.gep45 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, ptr %1, i64 0, i32 1
  store i64 4, ptr %.fca.1.gep45, align 8, !tbaa !3
  %.fca.2.gep47 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, ptr %1, i64 0, i32 2
  store i32 20180515, ptr %.fca.2.gep47, align 8, !tbaa !3
  %.fca.3.gep49 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, ptr %1, i64 0, i32 3
  store i8 1, ptr %.fca.3.gep49, align 4, !tbaa !3
  %.fca.4.gep51 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, ptr %1, i64 0, i32 4
  store i8 9, ptr %.fca.4.gep51, align 1, !tbaa !3
  %.fca.5.gep53 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, ptr %1, i64 0, i32 5
  store i8 0, ptr %.fca.5.gep53, align 2, !tbaa !3
  %.fca.6.gep55 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, ptr %1, i64 0, i32 6
  store i8 0, ptr %.fca.6.gep55, align 1, !tbaa !3
  %.fca.7.0.0.gep57 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, ptr %1, i64 0, i32 7, i64 0, i64 0
  store i64 1, ptr %.fca.7.0.0.gep57, align 8, !tbaa !3
  %.fca.7.0.1.gep59 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, ptr %1, i64 0, i32 7, i64 0, i64 1
  store i64 5, ptr %.fca.7.0.1.gep59, align 8, !tbaa !3
  %.fca.7.0.2.gep61 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, ptr %1, i64 0, i32 7, i64 0, i64 2
  store i64 4, ptr %.fca.7.0.2.gep61, align 8, !tbaa !3
  %32 = call i32 @_FortranAMinvalInteger4(ptr nonnull %1, ptr nonnull @_QQcl.1b78324675022a492a13f6c70f069756, i32 16, i32 0, ptr null)
  store ptr null, ptr %3, align 8, !tbaa !3
  %.fca.1.gep = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, ptr %3, i64 0, i32 1
  store i64 4, ptr %.fca.1.gep, align 8, !tbaa !3
  %.fca.2.gep = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, ptr %3, i64 0, i32 2
  store i32 20180515, ptr %.fca.2.gep, align 8, !tbaa !3
  %.fca.3.gep = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, ptr %3, i64 0, i32 3
  store i8 1, ptr %.fca.3.gep, align 4, !tbaa !3
  %.fca.4.gep = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, ptr %3, i64 0, i32 4
  store i8 9, ptr %.fca.4.gep, align 1, !tbaa !3
  %.fca.5.gep = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, ptr %3, i64 0, i32 5
  store i8 2, ptr %.fca.5.gep, align 2, !tbaa !3
  %.fca.6.gep = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, ptr %3, i64 0, i32 6
  store i8 0, ptr %.fca.6.gep, align 1, !tbaa !3
  %.fca.7.0.0.gep = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, ptr %3, i64 0, i32 7, i64 0, i64 0
  store i64 1, ptr %.fca.7.0.0.gep, align 8, !tbaa !3
  %.fca.7.0.1.gep = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, ptr %3, i64 0, i32 7, i64 0, i64 1
  store i64 0, ptr %.fca.7.0.1.gep, align 8, !tbaa !3
  %.fca.7.0.2.gep = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, ptr %3, i64 0, i32 7, i64 0, i64 2
  store i64 4, ptr %.fca.7.0.2.gep, align 8, !tbaa !3
  %33 = call {} @_FortranAMinlocInteger4(ptr nonnull %3, ptr nonnull %1, i32 4, ptr nonnull @_QQcl.1b78324675022a492a13f6c70f069756, i32 17, ptr null, i1 false)
  %.fca.0.load = load ptr, ptr %3, align 8, !tbaa !3
  %34 = load i32, ptr %.fca.0.load, align 4, !tbaa !7
  call void @free(ptr %.fca.0.load)
  %35 = load i32, ptr %5, align 4, !tbaa !7
  %36 = icmp eq i32 %35, 10
  %37 = load i32, ptr %4, align 4, !tbaa !7
  %.fr = freeze i32 %37
  br i1 %36, label %42, label %38

38:                                               ; preds = %0
  %39 = srem i32 %.fr, 10
  %40 = add i32 %.fr, 10
  %41 = sub i32 %40, %39
  br label %42

42:                                               ; preds = %0, %38
  %.1 = phi i32 [ %41, %38 ], [ %.fr, %0 ]
  %43 = load i32, ptr %15, align 4, !tbaa !7
  %44 = icmp eq i32 %43, 10
  %45 = load i32, ptr %12, align 4, !tbaa !7
  %.fr.1 = freeze i32 %45
  br i1 %44, label %51, label %46

46:                                               ; preds = %42
  %47 = srem i32 %.fr.1, 10
  %48 = add i32 %.1, 10
  %49 = add i32 %48, %.fr.1
  %50 = sub i32 %49, %47
  br label %53

51:                                               ; preds = %42
  %52 = add i32 %.fr.1, %.1
  br label %53

53:                                               ; preds = %51, %46
  %.1.1 = phi i32 [ %52, %51 ], [ %50, %46 ]
  %54 = load i32, ptr %20, align 4, !tbaa !7
  %55 = icmp eq i32 %54, 10
  %56 = load i32, ptr %17, align 4, !tbaa !7
  %.fr.2 = freeze i32 %56
  br i1 %55, label %62, label %57

57:                                               ; preds = %53
  %58 = srem i32 %.fr.2, 10
  %59 = add i32 %.1.1, 10
  %60 = add i32 %59, %.fr.2
  %61 = sub i32 %60, %58
  br label %64

62:                                               ; preds = %53
  %63 = add i32 %.fr.2, %.1.1
  br label %64

64:                                               ; preds = %62, %57
  %.1.2 = phi i32 [ %63, %62 ], [ %61, %57 ]
  %65 = load i32, ptr %25, align 4, !tbaa !7
  %66 = icmp eq i32 %65, 10
  %67 = load i32, ptr %22, align 4, !tbaa !7
  %.fr.3 = freeze i32 %67
  br i1 %66, label %73, label %68

68:                                               ; preds = %64
  %69 = srem i32 %.fr.3, 10
  %70 = add i32 %.1.2, 10
  %71 = add i32 %70, %.fr.3
  %72 = sub i32 %71, %69
  br label %75

73:                                               ; preds = %64
  %74 = add i32 %.fr.3, %.1.2
  br label %75

75:                                               ; preds = %73, %68
  %.1.3 = phi i32 [ %74, %73 ], [ %72, %68 ]
  %76 = load i32, ptr %30, align 4, !tbaa !7
  %77 = icmp eq i32 %76, 10
  %78 = load i32, ptr %27, align 4, !tbaa !7
  %.fr.4 = freeze i32 %78
  br i1 %77, label %84, label %79

79:                                               ; preds = %75
  %80 = srem i32 %.fr.4, 10
  %81 = add i32 %.1.3, 10
  %82 = add i32 %81, %.fr.4
  %83 = sub i32 %82, %80
  br label %86

84:                                               ; preds = %75
  %85 = add i32 %.fr.4, %.1.3
  br label %86

86:                                               ; preds = %84, %79
  %.1.4 = phi i32 [ %85, %84 ], [ %83, %79 ]
  %87 = add i32 %.1.4, -10
  %88 = sext i32 %34 to i64
  %89 = add nsw i64 %88, -1
  %90 = getelementptr [5 x i32], ptr %5, i64 0, i64 %89
  %91 = load i32, ptr %90, align 4, !tbaa !7
  %92 = add i32 %87, %91
  %93 = call ptr @_FortranAioBeginExternalFormattedOutput(ptr nonnull @_QQcl.28693029, i64 4, ptr null, i32 -1, ptr nonnull @_QQcl.1b78324675022a492a13f6c70f069756, i32 29)
  %94 = call i1 @_FortranAioOutputInteger32(ptr %93, i32 %92)
  %95 = call i32 @_FortranAioEndIoStatement(ptr %93)
  ret void
}

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

declare i1 @_FortranAioInputDescriptor(ptr, ptr) local_unnamed_addr

declare i32 @_FortranAioEndIoStatement(ptr) local_unnamed_addr

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

declare {} @_FortranAMinlocInteger4(ptr, ptr, i32, ptr, i32, ptr, i1) local_unnamed_addr

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

declare i1 @_FortranAioOutputInteger32(ptr, i32) local_unnamed_addr

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

!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 = !{!"descriptor member", !5, i64 0}
!5 = !{!"any access", !6, i64 0}
!6 = !{!"Flang Type TBAA Root"}
!7 = !{!8, !8, i64 0}
!8 = !{!"any data access", !5, i64 0}
