INTEGER A,B,C,X,ANS
READ*,A,B,C,X
ANS=0
DO I=0,A
  DO J=0,B
    DO K=0,C
      IF(I*500+J*100+K*50==X)ANS=ANS+1
      IF(I*500+J*100+K*50>X)EXIT
    END DO
    IF(I*500+J*100>X)EXIT
  END DO
  IF(I*500>X)EXIT
END DO
PRINT"(I0)",ANS
END
; 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.29c64e4ef649fe82412290b1354213b2 = linkonce constant [73 x i8] c"/home/ubuntu/Downloads/TheStack_IR/Collated/Fortran/Source_6311/source.f\00"
@_QQcl.28493029 = linkonce constant [4 x i8] c"(I0)"
@_QQEnvironmentDefaults = local_unnamed_addr constant ptr null

define void @_QQmain() local_unnamed_addr {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = tail call ptr @_FortranAioBeginExternalListInput(i32 -1, ptr nonnull @_QQcl.29c64e4ef649fe82412290b1354213b2, i32 2)
  %6 = call i1 @_FortranAioInputInteger(ptr %5, ptr nonnull %1, i32 4)
  %7 = call i1 @_FortranAioInputInteger(ptr %5, ptr nonnull %2, i32 4)
  %8 = call i1 @_FortranAioInputInteger(ptr %5, ptr nonnull %3, i32 4)
  %9 = call i1 @_FortranAioInputInteger(ptr %5, ptr nonnull %4, i32 4)
  %10 = call i32 @_FortranAioEndIoStatement(ptr %5)
  %11 = load i32, ptr %1, align 4, !tbaa !3
  %12 = icmp ult i32 %11, 2147483647
  br i1 %12, label %.lr.ph, label %._crit_edge

.lr.ph:                                           ; preds = %0
  %13 = load i32, ptr %2, align 4, !tbaa !3
  %14 = icmp ult i32 %13, 2147483647
  %15 = load i32, ptr %3, align 4
  %16 = add i32 %15, 1
  %17 = load i32, ptr %4, align 4
  %18 = icmp ult i32 %15, 2147483647
  %or.cond = select i1 %14, i1 %18, i1 false
  br i1 %or.cond, label %.lr.ph35.us.us.preheader, label %._crit_edge

.lr.ph35.us.us.preheader:                         ; preds = %.lr.ph
  %19 = add nuw nsw i32 %13, 1
  %smin59 = call i32 @llvm.smin.i32(i32 %13, i32 0)
  %20 = sub nuw nsw i32 %19, %smin59
  %21 = add nuw nsw i32 %11, 1
  %smin60 = call i32 @llvm.smin.i32(i32 %11, i32 0)
  %22 = sub nuw nsw i32 %21, %smin60
  br label %.lr.ph35.us.us

.lr.ph35.us.us:                                   ; preds = %._crit_edge36.split.us.us.us, %.lr.ph35.us.us.preheader
  %.02143.us.us = phi i32 [ 0, %.lr.ph35.us.us.preheader ], [ %25, %._crit_edge36.split.us.us.us ]
  %.02242.us.us = phi i32 [ 0, %.lr.ph35.us.us.preheader ], [ %spec.select.us.us.us, %._crit_edge36.split.us.us.us ]
  %23 = mul i32 %.02143.us.us, 500
  br label %.lr.ph.us.us.us

._crit_edge36.split.us.us.us:                     ; preds = %._crit_edge.us.us.us
  %24 = icmp sgt i32 %23, %17
  %25 = add nuw i32 %.02143.us.us, 1
  %exitcond61.not = icmp eq i32 %25, %22
  %or.cond62 = select i1 %24, i1 true, i1 %exitcond61.not
  br i1 %or.cond62, label %._crit_edge, label %.lr.ph35.us.us

.lr.ph.us.us.us:                                  ; preds = %._crit_edge.us.us.us, %.lr.ph35.us.us
  %.02033.us.us.us = phi i32 [ 0, %.lr.ph35.us.us ], [ %39, %._crit_edge.us.us.us ]
  %.132.us.us.us = phi i32 [ %.02242.us.us, %.lr.ph35.us.us ], [ %spec.select.us.us.us, %._crit_edge.us.us.us ]
  %26 = mul i32 %.02033.us.us.us, 100
  %27 = add i32 %26, %23
  br label %28

28:                                               ; preds = %34, %.lr.ph.us.us.us
  %.028.us.us.us = phi i32 [ 0, %.lr.ph.us.us.us ], [ %36, %34 ]
  %.227.us.us.us = phi i32 [ %.132.us.us.us, %.lr.ph.us.us.us ], [ %spec.select.us.us.us, %34 ]
  %.02526.us.us.us = phi i32 [ %16, %.lr.ph.us.us.us ], [ %35, %34 ]
  %29 = mul i32 %.028.us.us.us, 50
  %30 = add i32 %27, %29
  %31 = icmp eq i32 %30, %17
  %32 = zext i1 %31 to i32
  %spec.select.us.us.us = add i32 %.227.us.us.us, %32
  %33 = icmp sgt i32 %30, %17
  br i1 %33, label %._crit_edge.us.us.us, label %34

34:                                               ; preds = %28
  %35 = add nsw i32 %.02526.us.us.us, -1
  %36 = add nuw nsw i32 %.028.us.us.us, 1
  %37 = icmp sgt i32 %.02526.us.us.us, 1
  br i1 %37, label %28, label %._crit_edge.us.us.us

._crit_edge.us.us.us:                             ; preds = %34, %28
  %38 = icmp sgt i32 %27, %17
  %39 = add nuw i32 %.02033.us.us.us, 1
  %exitcond.not = icmp eq i32 %39, %20
  %or.cond63 = select i1 %38, i1 true, i1 %exitcond.not
  br i1 %or.cond63, label %._crit_edge36.split.us.us.us, label %.lr.ph.us.us.us

._crit_edge:                                      ; preds = %._crit_edge36.split.us.us.us, %.lr.ph, %0
  %.6 = phi i32 [ 0, %0 ], [ 0, %.lr.ph ], [ %spec.select.us.us.us, %._crit_edge36.split.us.us.us ]
  %40 = call ptr @_FortranAioBeginExternalFormattedOutput(ptr nonnull @_QQcl.28493029, i64 4, ptr null, i32 -1, ptr nonnull @_QQcl.29c64e4ef649fe82412290b1354213b2, i32 14)
  %41 = call i1 @_FortranAioOutputInteger32(ptr %40, i32 %.6)
  %42 = 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 ptr @_FortranAioBeginExternalFormattedOutput(ptr, i64, ptr, i32, ptr, i32) local_unnamed_addr

declare i1 @_FortranAioOutputInteger32(ptr, i32) local_unnamed_addr

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

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

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