program digital_gifts
  implicit none
  integer :: n, i, j = 0
  character(1) :: u
  real(8) :: x, b = 0.d0
  character(64) :: s
  read(*,*) n
  do i = 1, n
    read(*,*) x, u
    if (u == "J") then
      j = j+nint(x)
    else
      b = b+x
    end if
  end do
  write(s,'(f32.16)') 380000.d0*b+j
  write(*,'(a)') trim(adjustl(s))
end program digital_gifts
; 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"

@_QFEb = internal unnamed_addr global double 0.000000e+00
@_QFEj = internal unnamed_addr global i32 0
@_QFEs = internal global [64 x i8] undef
@_QQcl.50ec8108e3db3de9646773b8a61f21b1 = linkonce constant [73 x i8] c"/home/ubuntu/Downloads/TheStack_IR/Collated/Fortran/Source_4870/source.f\00"
@_QQcl.4A = linkonce constant [1 x i8] c"J"
@_QQcl.286633322E313629 = linkonce constant [8 x i8] c"(f32.16)"
@_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 i32, align 4
  %6 = alloca [1 x i8], align 1
  %7 = alloca double, align 8
  %8 = tail call ptr @_FortranAioBeginExternalListInput(i32 -1, ptr nonnull @_QQcl.50ec8108e3db3de9646773b8a61f21b1, i32 7)
  %9 = call i1 @_FortranAioInputInteger(ptr %8, ptr nonnull %5, i32 4)
  %10 = call i32 @_FortranAioEndIoStatement(ptr %8)
  %11 = load i32, ptr %5, align 4, !tbaa !3
  %12 = icmp sgt i32 %11, 0
  br i1 %12, label %.lr.ph.preheader, label %._crit_edge

.lr.ph.preheader:                                 ; preds = %0
  %13 = zext i32 %11 to i64
  br label %.lr.ph

.lr.ph:                                           ; preds = %.lr.ph.preheader, %29
  %14 = phi i64 [ %30, %29 ], [ %13, %.lr.ph.preheader ]
  %15 = call ptr @_FortranAioBeginExternalListInput(i32 -1, ptr nonnull @_QQcl.50ec8108e3db3de9646773b8a61f21b1, i32 9)
  %16 = call i1 @_FortranAioInputReal64(ptr %15, ptr nonnull %7)
  %17 = call i1 @_FortranAioInputAscii(ptr %15, ptr nonnull %6, i64 1)
  %18 = call i32 @_FortranAioEndIoStatement(ptr %15)
  %19 = call i32 @_FortranACharacterCompareScalar1(ptr nonnull %6, ptr nonnull @_QQcl.4A, i64 1, i64 1)
  %20 = icmp eq i32 %19, 0
  %21 = load double, ptr %7, align 8, !tbaa !3
  br i1 %20, label %22, label %26

22:                                               ; preds = %.lr.ph
  %23 = load i32, ptr @_QFEj, align 4, !tbaa !3
  %24 = call i32 @llvm.lround.i32.f64(double %21)
  %25 = add i32 %24, %23
  store i32 %25, ptr @_QFEj, align 4, !tbaa !3
  br label %29

26:                                               ; preds = %.lr.ph
  %27 = load double, ptr @_QFEb, align 8, !tbaa !3
  %28 = fadd contract double %27, %21
  store double %28, ptr @_QFEb, align 8, !tbaa !3
  br label %29

29:                                               ; preds = %22, %26
  %30 = add nsw i64 %14, -1
  %31 = icmp sgt i64 %14, 1
  br i1 %31, label %.lr.ph, label %._crit_edge

._crit_edge:                                      ; preds = %29, %0
  %32 = call ptr @_FortranAioBeginInternalFormattedOutput(ptr nonnull @_QFEs, i64 64, ptr nonnull @_QQcl.286633322E313629, i64 8, ptr null, ptr null, i64 0, ptr nonnull @_QQcl.50ec8108e3db3de9646773b8a61f21b1, i32 16)
  %33 = load double, ptr @_QFEb, align 8, !tbaa !3
  %34 = fmul contract double %33, 3.800000e+05
  %35 = load i32, ptr @_QFEj, align 4, !tbaa !3
  %36 = sitofp i32 %35 to double
  %37 = fadd contract double %34, %36
  %38 = call i1 @_FortranAioOutputReal64(ptr %32, double %37)
  %39 = call i32 @_FortranAioEndIoStatement(ptr %32)
  %40 = call ptr @_FortranAioBeginExternalFormattedOutput(ptr nonnull @_QQcl.286129, i64 3, ptr null, i32 -1, ptr nonnull @_QQcl.50ec8108e3db3de9646773b8a61f21b1, i32 17)
  store ptr @_QFEs, ptr %2, align 8, !tbaa !7
  %.fca.1.gep44 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8 }, ptr %2, i64 0, i32 1
  store i64 64, ptr %.fca.1.gep44, align 8, !tbaa !7
  %.fca.2.gep45 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8 }, ptr %2, i64 0, i32 2
  store i32 20180515, ptr %.fca.2.gep45, align 8, !tbaa !7
  %.fca.3.gep46 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8 }, ptr %2, i64 0, i32 3
  store i8 0, ptr %.fca.3.gep46, align 4, !tbaa !7
  %.fca.4.gep47 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8 }, ptr %2, i64 0, i32 4
  store i8 40, ptr %.fca.4.gep47, align 1, !tbaa !7
  %.fca.5.gep48 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8 }, ptr %2, i64 0, i32 5
  store i8 0, ptr %.fca.5.gep48, align 2, !tbaa !7
  %.fca.6.gep49 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8 }, ptr %2, i64 0, i32 6
  store i8 0, ptr %.fca.6.gep49, align 1, !tbaa !7
  %.fca.1.gep = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8 }, ptr %4, i64 0, i32 1
  %.fca.2.gep = 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.gep, align 8, !tbaa !7
  %.fca.3.gep = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8 }, ptr %4, i64 0, i32 3
  store i8 0, ptr %.fca.3.gep, align 4, !tbaa !7
  %.fca.4.gep = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8 }, ptr %4, i64 0, i32 4
  store i8 40, ptr %.fca.4.gep, align 1, !tbaa !7
  %.fca.5.gep = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8 }, ptr %4, i64 0, i32 5
  store i8 2, ptr %.fca.5.gep, align 2, !tbaa !7
  %.fca.6.gep = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8 }, ptr %4, i64 0, i32 6
  store i8 0, ptr %.fca.6.gep, align 1, !tbaa !7
  %41 = call {} @_FortranAAdjustl(ptr nonnull %4, ptr nonnull %2, ptr nonnull @_QQcl.50ec8108e3db3de9646773b8a61f21b1, i32 17)
  %.fca.0.load = load ptr, ptr %4, align 8, !tbaa !7
  %.fca.1.load = load i64, ptr %.fca.1.gep, align 8, !tbaa !7
  store ptr %.fca.0.load, ptr %1, align 8, !tbaa !7
  %.fca.1.gep110 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8 }, ptr %1, i64 0, i32 1
  store i64 %.fca.1.load, ptr %.fca.1.gep110, align 8, !tbaa !7
  %.fca.2.gep112 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8 }, ptr %1, i64 0, i32 2
  store i32 20180515, ptr %.fca.2.gep112, align 8, !tbaa !7
  %.fca.3.gep114 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8 }, ptr %1, i64 0, i32 3
  store i8 0, ptr %.fca.3.gep114, align 4, !tbaa !7
  %.fca.4.gep116 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8 }, ptr %1, i64 0, i32 4
  store i8 40, ptr %.fca.4.gep116, align 1, !tbaa !7
  %.fca.5.gep118 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8 }, ptr %1, i64 0, i32 5
  store i8 0, ptr %.fca.5.gep118, align 2, !tbaa !7
  %.fca.6.gep120 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8 }, ptr %1, i64 0, i32 6
  store i8 0, ptr %.fca.6.gep120, align 1, !tbaa !7
  %.fca.1.gep11 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8 }, ptr %3, i64 0, i32 1
  %.fca.2.gep13 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8 }, ptr %3, i64 0, i32 2
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(16) %3, i8 0, i64 16, i1 false)
  store i32 20180515, ptr %.fca.2.gep13, align 8, !tbaa !7
  %.fca.3.gep15 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8 }, ptr %3, i64 0, i32 3
  store i8 0, ptr %.fca.3.gep15, align 4, !tbaa !7
  %.fca.4.gep17 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8 }, ptr %3, i64 0, i32 4
  store i8 40, ptr %.fca.4.gep17, align 1, !tbaa !7
  %.fca.5.gep19 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8 }, ptr %3, i64 0, i32 5
  store i8 2, ptr %.fca.5.gep19, align 2, !tbaa !7
  %.fca.6.gep21 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8 }, ptr %3, i64 0, i32 6
  store i8 0, ptr %.fca.6.gep21, align 1, !tbaa !7
  %42 = call {} @_FortranATrim(ptr nonnull %3, ptr nonnull %1, ptr nonnull @_QQcl.50ec8108e3db3de9646773b8a61f21b1, i32 17)
  %.fca.0.load23 = load ptr, ptr %3, align 8, !tbaa !7
  %.fca.1.load26 = load i64, ptr %.fca.1.gep11, align 8, !tbaa !7
  %43 = call i1 @_FortranAioOutputAscii(ptr %40, ptr %.fca.0.load23, i64 %.fca.1.load26)
  call void @free(ptr %.fca.0.load23)
  call void @free(ptr %.fca.0.load)
  %44 = call i32 @_FortranAioEndIoStatement(ptr %40)
  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 @_FortranAioInputReal64(ptr, ptr) local_unnamed_addr

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

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

; Function Attrs: mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.lround.i32.f64(double) #1

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

declare i1 @_FortranAioOutputReal64(ptr, double) 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 {} @_FortranAAdjustl(ptr, ptr, ptr, i32) local_unnamed_addr

declare {} @_FortranATrim(ptr, ptr, ptr, i32) 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 = { mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) }
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}
